rafaelklaessen / react-tradingview-widget

React component for rendering the TradingView Advanced Real-Time Chart Widget.
MIT License
273 stars 94 forks source link

React Native ? #40

Open bytemtek opened 4 years ago

bytemtek commented 4 years ago

How I can use it React Native ?

Great-hijack commented 4 years ago

still no solution?

tad3j commented 4 years ago

TV widget loads HTML which can't be rendered in React Native directly. Solution is to use WebView and pass original widget HTML/JS as html prop (no need to use this package, although I guess it may also be possible).

        <WebView
          source={{ html }}
          style={styles.webView}
          startInLoadingState={true}
          originWhitelist={['*']}
          onLoadEnd={
            (/*e*/) => {
              if (!loaded) {
                setLoaded(true)
              }
            }
          }
        />