VisualProvider

The VisualProvider is a gateway to pass the translation function and online/offline state to the components provided in this module.

import { VisualContext } from '@dormakaba/digital-reactnative-visual';

// the provider
<VisualContext.Provider value={{ t, offline }}>
  {/* ... */}
</VisualContext.Provider>

// the consumer
<VisualContext.Consumer>
  {({ t, offline }) => <MyComponent t={t} offline={offline} />}
</VisualContext.Consumer>

If you're using the @dormakaba/digital-reactnative-client the DokaApp component will do bootstrap the provider for you.

Last updated