From ea258e7cfd6aae30c32e3a58f821f76e17ede817 Mon Sep 17 00:00:00 2001 From: Alvin Kristanto Date: Wed, 24 Jul 2019 10:54:57 +0700 Subject: [PATCH] fix(redux-plugin): change json parse to flatted parse (#16) --- packages/redux-plugin/src/withRedux.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/redux-plugin/src/withRedux.jsx b/packages/redux-plugin/src/withRedux.jsx index ff8d223..9208aa2 100644 --- a/packages/redux-plugin/src/withRedux.jsx +++ b/packages/redux-plugin/src/withRedux.jsx @@ -1,5 +1,6 @@ import React from 'react'; import { Provider } from 'react-redux'; +import { parse } from 'flatted'; import hoistStatics from 'hoist-non-react-statics'; import { STORE_KEY } from './const'; @@ -42,7 +43,7 @@ export const withRedux = (makeStoreClient) => { if (initialState) { const { textContent } = initialState; - data = JSON.parse(textContent || ''); + data = parse(textContent || ''); // remove element after hydrate initialState.remove();