You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title suggests, I am curious if slash supports the useSyncExternalStore!
Currently, I am considering a useNetwork hook that uses useSyncExternalStore to subscribe to the browser's network connection status and handle sudden network disconnections while the user is using the application.
const{ isOnline }=useNetwork({onlineCallback: ()=>{// ...},offlineCallback: ()=>{navigate('/offline');// It handles sudden network disconnections for the user.},});
useNetwork Example
There is a simple example in the above document, so please feel free to check it out.
I have based it on the example from react.dev - useOnlineStatus, but have extended it by adding onlineCallback and offlineCallback functionalities.
I think it would be great if slash also provided a useNetwork hook. However, I need to know whether useSyncExternalStore is supported and hear the administrators' opinions first, so I am creating this issue.
The text was updated successfully, but these errors were encountered:
Package Scope
Package name: @toss/react
Overview
As the title suggests, I am curious if slash supports the
useSyncExternalStore
!Currently, I am considering a
useNetwork
hook that usesuseSyncExternalStore
to subscribe to the browser's network connection status and handle sudden network disconnections while the user is using the application.useNetwork implementation code
The above link is the implementation code for useNetwork that I am currently working on.
useNetwork Example
There is a simple example in the above document, so please feel free to check it out.
I have based it on the example from react.dev - useOnlineStatus, but have extended it by adding
onlineCallback
andofflineCallback
functionalities.I think it would be great if
slash
also provided auseNetwork
hook. However, I need to know whetheruseSyncExternalStore
is supported and hear the administrators' opinions first, so I am creating this issue.The text was updated successfully, but these errors were encountered: