eftalyurtseven / react-native-wheel-of-fortune

React Native Wheel of Fortune Plugin
103 stars 89 forks source link

TypeError: undefined is not an object (evaluating '_this.props.options.rewards') #41

Open AslamSymsafe opened 2 years ago

AslamSymsafe commented 2 years ago

i have installed this module and applied the example code getting error undefined is not an object (evaluating '_this.props.options.rewards')

const participants = [ '%10', '%20', '%30', '%40', '%50', '%60', '%70', '%90', 'FREE', ]; const wheelOptions = { rewards: participants, knobSize: 50, borderWidth: 5, borderColor: '#000', innerRadius: 50, duration: 4000, backgroundColor: 'transparent', textAngle: 'horizontal', // knobSource: require('../assets/knob.png'), getWinner: (value, index) => { this.setState({winnerValue: value, winnerIndex: index}); }, onRef: ref => (this.child = ref), };

return (

)

KrishEnacton commented 2 years ago
 <WheelOfFortune wheelOptions={wheelOptions} options={wheelOptions} />

Pass wheelOptions in "options" props