React Native API reference
In this section, you'll find the complete documentation for the components exposed in @knocklabs/react-native
, including the props available.
Note: You can see a reference for the methods available for the Knock
class, as well as a Feed
instance under the client JS docs.
Components
KnockFeedProvider
The top-level feed provider that connects to Knock with the given API key, authenticates a user, and then connects to a feed for that user.
Props
Accepts KnockFeedProviderProps
:
KnockI18nProvider
A provider to inject translations into components.
Props
Hooks
useKnockFeed
The KnockFeedProvider
exposes a useKnockFeed
hook for all child components.
Returns: KnockFeedProviderState
Example:
useAuthenticatedKnockClient
Creates an authenticated Knock client.
Returns: Knock
instance, authenticated against the user
Example:
useNotifications
Creates a Feed
instance for the provided Knock
client which creates a stateful, real-time connection to Knock to build in-app experiences.
Returns: Feed
instance
Example:
useTranslations
Exposed under KnockI18nProvider
child components.
Returns:
Types
I18nContent
Used to set translations available in the child components exposed under KnockFeedProvider
. Used in the useTranslations
hook.
Note: locale
must be a valid locale code.