我有一个react元素testReactElement,希望在屏幕上显示它,即使在用户关闭该选项卡并再次打开它之后,他们也会发现仍然显示相同的数据,所以我将它放在localStorage上,并向localStorage中添加一个react元素--我首先应该使用JSON.stringify()将其字符串化,然后它成功地存储在localstorage中,当我想从本地存储中检索并显示它时,我使用JSON.parse()。is the content of the react element&l
我已经在react项目中安装了jest和jsdom,但是在导入使用window.localStorage变量的react组件时遇到了问题。= window.localStorage;'use strict';import React from 'react';
import jsdom from 'jsdom