Error when trying to use Button in react-native

南笙酒味 提交于 2019-11-29 07:01:45

I've just tested your code on version 0.55. It was perfectly correct and worked fine. I'm likely to have error with your react-native version.

init lower version

react-native init --version="react-native@0.55.0" YOUR_APP_NAME

before that try this also

<Button
    onPress={() => alert('hi')}
    title="Press Me"
 >
   Press Me
</Button>

A new version of react-native 0.57.4 is now out. Please update your react native version. I tested with the new version and just working fine now.

Hope it works for you too! :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!