Closed chrisehlee closed 5 years ago
Please try the following syntax and make sure you have hook-supported react(> 16.8) & react native(> 0.59) versions installed . I'll close this issue for now. If you have any further concerns or questions, feel free to reopen this issue.
function test() {
const hsvColorPicker = useRef(null);
const getColor = () => {
console.log(hsvColorPicker.current.getCurrentColor());
};
return (
<>
<HsvColorPicker
ref={hsvColorPicker}
// more props...
/>
<TouchableOpacity onPress={getColor}>
<Text>Get Current Color</Text>
</TouchableOpacity>
</>
);
}
I have a react native screen in which i'm using the
useRef()
hook to set a ref for theHsvColorPicker
.. however, i can't access thegetCurrentColor()
method of it as i get a