From 4e85f42b19d25ea2f89de1e77ddbd944e74bea00 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 9 Feb 2021 11:27:20 +0100 Subject: [PATCH] docs: escapeHTML note --- README.md | 5 +++-- src/rootStore.ts | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 98810309..248867c5 100644 --- a/README.md +++ b/README.md @@ -318,8 +318,9 @@ app.use(pinia) // after rendering the page, the root state is build and can be read // serialize, escape (VERY important if the content of the state can be changed // by the user, which is almost always the case), and place it somewhere on -// the page, for example, as a global variable. -JSON.stringify(pinia.state.value) +// the page, for example, as a global variable. Note you need to use your own +// `escapeHTML()` function or use an existing package +escapeHTML(JSON.stringify(pinia.state.value)) ``` On client side, you must hydrate pinia's state before calling any `useStore()` function. For example, if we serialize the state into a `