Daily React Hooks

Daily React Hooks is a helper library for handling common patterns when building custom Daily applications in React. It makes it easier to manage state and integrate daily-js methods and events in any React app.

While it is not required to use daily-react-hooks when building with Daily and React, it is strongly recommended. We use the library internally: Daily Prebuilt, our ready-to-use embeddable video chat interface, uses daily-react-hooks. We've tested the library extensively, and it is our preferred way to handle Daily events.

Using daily-react-hooks

Install the library

Install Daily React Hooks from the npm public registry.

npm install @daily-co/daily-react-hooks @daily-co/daily-js recoil

The reason for installing @daily-co/daily-js and recoil separately is that they are peer dependencies. This ensures that if you want to use either recoil or daily-js in addition to daily-react-hooks, such as to create your own call object, both your manual usage and daily-react-hooks will utilize the same version of each library.

DailyProvider component

DailyProvider is a component which gives every other component in your application access to the Daily call object.

Available hooks