Skip to content

Commit

Permalink
Merge pull request #1715 from FormidableLabs/bug/safe-stringify
Browse files Browse the repository at this point in the history
use safe stringify
  • Loading branch information
boygirl authored Oct 14, 2020
2 parents 9639dc5 + 946d8e6 commit 23a65fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@
"deploy:stage": "formideploy deploy --staging",
"deploy:prod": "formideploy deploy --production"
}
}
}
1 change: 1 addition & 0 deletions packages/victory-shared-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"author": "Formidable",
"license": "MIT",
"dependencies": {
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.19",
"prop-types": "^15.5.8",
"react-fast-compare": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/victory-shared-events/src/victory-shared-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from "react";
import PropTypes from "prop-types";
import { PropTypes as CustomPropTypes, Events, Helpers, TimerContext } from "victory-core";
import isEqual from "react-fast-compare";
import stringify from "json-stringify-safe";

export default class VictorySharedEvents extends React.Component {
static displayName = "VictorySharedEvents";
Expand Down Expand Up @@ -171,7 +172,7 @@ export default class VictorySharedEvents extends React.Component {
name,
baseProps,
childEvents,
JSON.stringify(this.state[name])
stringify(this.state[name])
];

const sharedEvents = this.getCachedSharedEvents(name, sharedEventsCacheValues) || {
Expand Down

0 comments on commit 23a65fc

Please sign in to comment.