Install Candu's React client

Installation

Installing the client is straightforward and should take ~10 minutes. You have two options to install the client:

Node

Install Candu using node npm:

npm install --save candu-react

or if you prefer yarn:

yarn add candu-react

You can then initialize your instance of Candu by adding a provider

// index.js
... // Where you bootstrap your application
import { CanduProvider} from 'candu-react';
import YourApp from './YourApp';
ReactDOM.render(
<CanduProvider clientToken="YOUR_CLIENT_TOKEN" userId="USER_ID">
<YourApp />
</CanduProvider>,
document.getElementById('react-root')
)

Check the full API of the CanduProvider here.

Using the client

After you initialize the client, you can easily render a portal:

import { Portal } from 'candu-react';
const YourPortal = <Portal id="YOUR_PORTAL_ID" />

Check he full Portal API here.