ParaProvider component wraps your React application to provide access to Para hooks and manage the SDK instance.
Import
Usage
Loading State
By default,ParaProvider blocks rendering until the SDK is ready. You can customize this behavior:
With Fallback UI
Show a loading indicator instead of a blank screen while the SDK initializes:With Immediate Rendering
Render children immediately and let them handle the loading state usinguseParaStatus():
Advanced Usage
With Event Callbacks
With Custom Para Instance
This can be useful if you need to use the Para instance outside of the React tree, i.e. in the callbacks on the ParaProvider.Notes
- The
ParaProvidermust wrap any components that use Para hooks - It requires
QueryClientProviderfrom React Query as a parent - Event callbacks receive events with a
detailproperty containingdataand optionalerror - The provider automatically manages session keep-alive unless disabled
- By default, children are not rendered until the SDK is ready. Use
fallbackto show loading UI, orwaitForReady={false}to render children immediately - All child components can access Para hooks without additional setup