mirror of https://github.com/waku-org/js-waku.git
Use `const` as setter should be used to change values
This commit is contained in:
parent
a8e2b908ba
commit
bc3b00b13e
|
@ -74,10 +74,10 @@ async function retrieveStoreMessages(
|
|||
}
|
||||
|
||||
export default function App() {
|
||||
let [newMessages, setNewMessages] = useState<Message[]>([]);
|
||||
let [archivedMessages, setArchivedMessages] = useState<Message[]>([]);
|
||||
let [waku, setWaku] = useState<Waku | undefined>(undefined);
|
||||
let [nick, setNick] = useState<string>(() => {
|
||||
const [newMessages, setNewMessages] = useState<Message[]>([]);
|
||||
const [archivedMessages, setArchivedMessages] = useState<Message[]>([]);
|
||||
const [waku, setWaku] = useState<Waku | undefined>(undefined);
|
||||
const [nick, setNick] = useState<string>(() => {
|
||||
const persistedNick = window.localStorage.getItem('nick');
|
||||
return persistedNick !== null ? persistedNick : generate();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue