Skip to content

Commit

Permalink
fix: rehydrating booleans at the root of the state
Browse files Browse the repository at this point in the history
  • Loading branch information
jondewoo committed Dec 17, 2020
1 parent c38b89f commit 7d329a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const rehydrateApplicationState = (
const isObjectRegex = new RegExp('{|\\[');
let raw = stateSlice;

if (stateSlice === 'null' || isObjectRegex.test(stateSlice.charAt(0))) {
if (stateSlice === 'null' || stateSlice === 'true' || stateSlice === 'false' || isObjectRegex.test(stateSlice.charAt(0))) {
raw = JSON.parse(stateSlice, reviver);
}

Expand Down

0 comments on commit 7d329a6

Please sign in to comment.