File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -1384,26 +1384,13 @@ export function useSessionStorage(key, initialValue) {
13841384 typeof value === "function" ? value ( localState ) : value ;
13851385 window . sessionStorage . setItem ( key , JSON . stringify ( nextState ) ) ;
13861386 setLocalState ( nextState ) ;
1387- window . dispatchEvent ( new Event ( "session-storage" ) ) ;
13881387 } catch ( e ) {
13891388 console . warn ( e ) ;
13901389 }
13911390 } ,
13921391 [ key , localState ]
13931392 ) ;
13941393
1395- const onStorageChange = React . useEffectEvent ( ( ) => {
1396- setLocalState ( readValue ( ) ) ;
1397- } ) ;
1398-
1399- React . useEffect ( ( ) => {
1400- window . addEventListener ( "session-storage" , onStorageChange ) ;
1401-
1402- return ( ) => {
1403- window . removeEventListener ( "session-storage" , onStorageChange ) ;
1404- } ;
1405- } , [ ] ) ;
1406-
14071394 return [ localState , handleSetState ] ;
14081395}
14091396
You can’t perform that action at this time.
0 commit comments