Skip to content

Instantly share code, notes, and snippets.

@maapteh
Last active December 10, 2019 21:46
Show Gist options
  • Save maapteh/a0161e6ae48ca87823211a495a38c6ce to your computer and use it in GitHub Desktop.
Save maapteh/a0161e6ae48ca87823211a495a38c6ce to your computer and use it in GitHub Desktop.
wrong jsesc usage
const jsonString = jsesc(JSON.stringify(data), {
json: true,
isScriptContext: true
});
<script>window.__INITIAL_STATE__ = JSON.parse(${jsonString})</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment