# VisualProvider

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

```jsx
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>
```

{% hint style="info" %}
If you're using the [@dormakaba/digital-reactnative-client](https://dormakaba-digital.gitbook.io/reactnative-client/) the DokaApp component will do bootstrap the provider for you.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dormakaba-digital.gitbook.io/reactnative-visual/misc/visualprovider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
