This guide will walk you through the steps of replacing
Please report any issues you encounter while upgrading.
Install the new React package
Or if you're using Yarn:
@knocklabs/react introduces updated providers:
KnockProviderauthenticates the current user and provides access to the Knock client. It now accepts
KnockFeedProviderconnects to an in-app feed channel using the
feedIdprop and no longer accepts
This code sample demonstrates a typical implementation of the
NotificationFeedPopover and annotates
points of change in the component APIs.
With the new React SDK, the
KnockProvider component now wraps the
KnockFeedProvider component and handles authenticating with Knock.
KnockFeedProvider no longer wraps its children with default styles. If you were setting the
rootless prop to true, this change has no effect. Otherwise, you should wrap your notification feed with the
NotificationFeedContainer component to ensure the feed is properly styled.
You can continue to use the
useKnockFeed hook to build headless feed experiences.
You can use the
useKnockClient hook to access the Knock client.