mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
added fallback
This commit is contained in:
parent
5889b422c3
commit
94c0016cad
1 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ function wrapPromise(promise) {
|
|||
};
|
||||
}
|
||||
|
||||
const withGetInitState = (Component) => {
|
||||
const withGetInitState = (Component, Fallback = () => { }) => {
|
||||
return function WithGetInitState(props) {
|
||||
const { core } = useServices();
|
||||
const initStateRef = React.useRef({});
|
||||
|
|
@ -48,7 +48,7 @@ const withGetInitState = (Component) => {
|
|||
return initStateRef.current[model].read();
|
||||
}, []);
|
||||
return (
|
||||
<React.Suspense>
|
||||
<React.Suspense fallback={<Fallback {...props} />}>
|
||||
<GetInitStateContext.Provider value={getInitState}>
|
||||
<Component {...props} />
|
||||
</GetInitStateContext.Provider>
|
||||
|
|
|
|||
Loading…
Reference in a new issue