diff --git a/native/components/persisted-state-gate.js b/native/components/persisted-state-gate.js new file mode 100644 index 000000000..151b66c13 --- /dev/null +++ b/native/components/persisted-state-gate.js @@ -0,0 +1,16 @@ +// @flow + +import * as React from 'react'; + +import { usePersistedStateLoaded } from '../selectors/app-state-selectors'; + +function PersistedStateGate(props: { +children: React.Node }): React.Node { + const persistedStateLoaded = usePersistedStateLoaded(); + if (!persistedStateLoaded) { + return null; + } + + return props.children; +} + +export default PersistedStateGate;