L
Size: a a a
L
i
L
YP
VR
VH
i
YP
i
YP
AB
yarn create react-app my-app-typescript --template typescript?
XS
SA
AE
const get = (id) =>
JSON.parse(window.localStorage.getItem(id) || null);
const set = (id, value) => {
window.localStorage.setItem(id, JSON.stringify(value));
};
export { get, set };
______________
class Manager extends React.Component {
constructor(props) {
super(props);
this.state = {
data: []
};
if (!isToday(get(uuid))) {
this.getData();
}
if (isToday(get(uuid)) && !isToday(get(uuidNotice))) {
this.getNotice();
}
}
{ /*...*/ }
ReferenceError: window is not defined
i
i
SA
SA