Last active
December 10, 2019 21:46
-
-
Save maapteh/a0161e6ae48ca87823211a495a38c6ce to your computer and use it in GitHub Desktop.
wrong jsesc usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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