reactnative-client
  • @dormakaba/digital-reactnative-client
  • Getting started
  • Changelog
  • Concerns
    • App State
    • Global / Local Snacks
    • Forms
    • Navigation
    • i18n
    • rest api
  • Utils
    • formatters
    • EventEmitter
    • Logger
    • settings
    • validate
    • misc
Powered by GitBook
On this page
  1. Concerns

App State

PreviousChangelogNextGlobal / Local Snacks

Last updated 6 years ago

Will bootstrap the VisualProvider of the and give you information about your device.

Code sample

import { DokaApp, AppState } from '@dormakaba/digital-reactnative-client';

<DokaApp>
  <AppState>
    {({ offline, deviceInfo }) => (
      <View>
        <Text>{`is offline: ${offline}`}</Text>
        <Text>{JSON.stringify(deviceInfo)}</Text>
      </View>
    )}
  </AppState>
</DokaApp>

Use the DokaApp component once as a wrapper for you app.

deviceInfo will contain following information:

deviceInfo: {
  isTablet,
  width,
  height,
  isPortrait,
  isLandscape
}
digital-reactnative-visual