Can I use reactJS library in react-native?

前端 未结 1 1192
北海茫月
北海茫月 2020-12-18 23:36

Well, this might be a silly question but I want to clarify the reason. React-Native imports nodeJS libraries, so I think it is possible to use reactJS library as well though

相关标签:
1条回答
  • 2020-12-19 00:03

    react library actually does not have anything related to Browser DOM HTML. Anything related to it separated into react-dom package. React Native does not and cannot use this library, because you don't have DOM underneath a react native application. However you can use most of the code/functionality you wrote for your mobile app in the browser, if you install necessary transpiling library. This is possible because react native defines some primitive components that can be ported to almost any platform. If you still want to use just HTML to render inside react native, you may use WebView for it.

    0 讨论(0)
提交回复
热议问题