![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@daily-co/daily-react-hooks
Advanced tools
Daily React Hooks makes it easier to integrate [@daily-co/daily-js](https://www.npmjs.com/package/@daily-co/daily-js) in React applications.
Daily React Hooks makes it easier to integrate @daily-co/daily-js in React applications.
To get started with Daily React Hooks, include DailyProvider
in your app:
import { DailyProvider } from '@daily-co/daily-react-hooks';
function App({ roomUrl }) {
return (
<DailyProvider url={roomUrl}>
{/* … */}
</DailyProvider>
)
}
Then in your application you can access Daily React Hooks:
import { useParticipant, useParticipantIds } from '@daily-co/daily-react-hooks';
function ParticipantRow({ id }) {
const participant = useParticipant(id);
return (
<li style={{ display: 'flex', gap: 8 }}>
<span>{participant?.user_name ?? 'Guest'}</span>
<span>📷{participant?.tracks?.video?.state === 'playable' ? '✅' : '❌'}</span>
<span>🎙️{participant?.tracks?.audio?.state === 'playable' ? '✅' : '❌'}</span>
</li>
)
}
function Participants() {
const participantIds = useParticipantIds({
filter: 'remote',
sort: 'user_name'
});
return (
<ul>
{participantIds.map((id) => <ParticipantRow key={id} id={id} />)}
</ul>
)
}
Learn more about Daily React Hooks by reading our docs at https://docs.daily.co/reference/daily-react-hooks.
The daily-react-hooks
package is published to npm. To install the latest stable version, run one of the following commands:
npm install @daily-co/daily-react-hooks @daily-co/daily-js recoil
# or with yarn
yarn add @daily-co/daily-react-hooks @daily-co/daily-js recoil
Notice that @daily-co/daily-react-hooks
requires @daily-co/daily-js and recoil as peer dependencies.
@daily-co/daily-react-hooks
manages its internal state using recoil
. You can read more about recoil
in their Motivation statement.
We've set up automatic tests using jest and Testing Library. You can run the tests using the following command:
npm test
# or with yarn
yarn test
Please head over to our contributing guide to learn more about how you can contribute to daily-react-hooks
.
In case you've got general questions about Daily or need technical assistance, please reach out via help@daily.co.
FAQs
Daily React Hooks makes it easier to integrate [@daily-co/daily-js](https://www.npmjs.com/package/@daily-co/daily-js) in React applications.
The npm package @daily-co/daily-react-hooks receives a total of 174 weekly downloads. As such, @daily-co/daily-react-hooks popularity was classified as not popular.
We found that @daily-co/daily-react-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 25 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.