react-native-restart: Cannot read property Restart of undefined

When I install the dependency react-native-restart, I did the automatic installation via react-native link with successfully linked result.

Environment: macOs and iOS emulator

screen shot 2018-04-09 at 22 41 29

My usage is import RNRestart from 'react-native-restart';

and then in one action I call RNRestart.Restart();

but got error - ‘Cannot read property Restart of undefined’

screen shot 2018-04-09 at 22 40 16

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@shushuy thank you but still the same issue. Any solution guys for this 'undefined is not an object(evaluating ‘_reactNativeRestart2.default.Restart))’

@psloboda how about undefined is not an object (evaluating ‘_reactNativeRestart2.default.Restart’)? i got this error when i tried to click onPress={() => RNRestart.Restart()}