reactnative-visual
  • @dormakaba/digital-reactnative-visual
  • Getting started
  • Changelog
  • Components
    • Avatar
    • Button
    • Card
    • Checkbox / Radio
    • Icons
    • IconButton
    • Image Cropper
    • Page, Row, Col
    • List, ListItem
    • Modal
    • Notification
    • QR Code Reader
    • Select
    • Snack
    • Swipeable
    • Textfield
    • Typography: H1, P, Label, Hint, Text
  • Page Templates
    • Animated Login View
    • Login Area View
    • Animated Panel List
    • Animated Avatar View
  • Misc
    • Colors
    • VisualProvider
  • Show Cases
    • exivo
Powered by GitBook
On this page
  1. Misc

VisualProvider

PreviousColorsNextexivo

Last updated 6 years ago

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 the DokaApp component will do bootstrap the provider for you.

@dormakaba/digital-reactnative-client