react-native-wheel-of-fortune icon indicating copy to clipboard operation
react-native-wheel-of-fortune copied to clipboard

Is there any plan to moved it with React Native hooks (onRef issue)

Open leon2835 opened this issue 3 years ago • 7 comments

Hi there, after install the latest update (1.5.4). I don't think there is anyway to assign onRef with React Native hooks. useRef cannot assign onRef with function type (Since useRef is read only).

*Is there any plan to migrated to React hooks so far?

leon2835 avatar May 10 '21 07:05 leon2835

I will update docs as soon as possible thank you for your hands up 👍

eftalyurtseven avatar May 21 '21 05:05 eftalyurtseven

Hi @eftalyurtseven can you provide an update on this if possible. will be really helpful.

ANIBIT14 avatar Oct 01 '21 04:10 ANIBIT14

Hi, Thanks for your Effort waitting for update and realy good job

rmadi avatar Mar 13 '22 00:03 rmadi

Hi, The onRef issue still persists. Waiting for an update. Thank you!

AmrithVengalath avatar Apr 28 '22 06:04 AmrithVengalath

Hi There! @leon2835 How did you manage to fix this error in your project?

AmrithVengalath avatar Apr 28 '22 06:04 AmrithVengalath

I just use it as it is with class component

rmadi avatar Apr 28 '22 19:04 rmadi

You can use it like this inside a functional component with hooks:

const wheelRef = useRef(null)

const wheelOptions = {
  ...,
  onRef: ref => (wheelRef.current = ref)
}

return (
  <WheelOfFortune options={wheelOptions} />
)

simonschmalfeld avatar Sep 29 '22 14:09 simonschmalfeld