How to have source instead of html in WebView in React Native

后端 未结 2 450
一生所求
一生所求 2021-02-11 02:03

Recently, React Native has deprecated html and url props and replaced them with source.



        
相关标签:
2条回答
  • 2021-02-11 02:44

    Have you upgraded React Native version? It is deprecated on newer versions, check the documentation. If you are using older version of React Native, you should use html instead of source.

    0 讨论(0)
  • 2021-02-11 02:45
    <WebView source={{ html: "<h1>Hello</h1>" }} />
    

    Documentation available here: http://facebook.github.io/react-native/docs/webview.html#content

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