I'm loading this WebView in my app:
<WebView
style={{
marginTop: 5,
flex:1,
flexDirection: 'column',
alignItems:'center',
justifyContent: 'center',
backgroundColor: 'rgba(255,255,255,0.8)',
height:300
}}
source={require('./test.html')}
injectedJavaScript={injectedScript}
scalesPageToFit={true}
/>
Since I want this html file to display a string that I got just before the render was called - I want to do the following:
let injectedScript = `CKEDITOR.instances.editor.setData(${bodyForDisplay});`;
But it just doesn't work. When I replace the ${bodyForDisplay} with a static string (i.e "test") - it works flawlessly.
Any ideas on how to inject a dynamic value here?