Basically, when I render the <JsonView /> component for the first time, my default value is an empty object {}. When that value changes React strict mode throws the following warning:
Warning: Internal React error: Expected static flag was missing. Please notify the React team. Error Component Stack
As a workaround I made the default value a nested object and that made the warning go away.
Here is a small component that triggers the warning:
const JsonViewer: React.FC = () => {
const [json, setJson] = useState({});
useEffect(() => {
setJson({ "": { "": null } });
}, []);
return <JsonView data={json} shouldExpandNode={collapseAllNested} />;
};
I'm using react-json-view-lite version 2.3.0 and React 18.2.0.