JavaScript syntax highlighting for react-native-webview's injectedJavaScript and injectedJavaScriptBeforeContentLoaded props.
When using react-native-webview, injected scripts are plain strings — your editor treats them as opaque text with no syntax highlighting.
Before — no highlighting, hard to read:
After — full JavaScript syntax highlighting:
<WebView injectedJavaScript={`document.body.style.backgroundColor = 'red';`} />const script = `document.body.style.backgroundColor = 'red';`;
// ...
<WebView injectedJavaScript={script} />const script = "document.body.style.backgroundColor = 'red'";
// ...
<WebView injectedJavaScript={script} />All patterns work with both injectedJavaScript and injectedJavaScriptBeforeContentLoaded.
.js, .jsx, .ts, .tsx
- Variable tracking only works within the same file
- Variable shadowing is not handled — the first matching declaration is used
MIT

