Ability to hide and show without needing a ref
Closed this issue · 2 comments
peisenmann commented
As refs require a class (or some crazy trickery), it would be great if there were a show
prop that could be set to true
to show the picker and false
to hide it.
peisenmann commented
While I still feel like this isn't idiomatic React, it does seem to work
const MyComponent = ({value}) => {
let picker = null
return (<MonthPicker ref={ref => picker = ref}>
<div onClick={() => picker && picker.show()}>
...
</div>
</MonthPicker>)
}
nickeljew commented
please check v1.3.1