Skip to content
Discussion options

You must be logged in to vote

It should because of the devtools middleware. Remove it or adding the stateSanitizer option.

{
  name: "bear",
  stateSanitizer: (state) => {
    return JSON.parse(
      JSON.stringify(state, (_key, value) => {
        if (typeof value === "function") return undefined;
        if (value instanceof HTMLElement)
          return `${value.tagName} ${value.className}`;
        if (value instanceof Date) return value.toLocaleString();
        return value;
      })
    );
  },
}

The root cause should be related to facebook/react#24360
setting this property also work

HTMLElement.prototype.toJSON = () => "{}";

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MilesLeeeeee
Comment options

Answer selected by MilesLeeeeee
Comment options

You must be logged in to vote
1 reply
@MilesLeeeeee
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please someone help on this
4 participants
Converted from issue

This discussion was converted from issue #2069 on September 25, 2023 11:47.