How to convert HTML to JSX (React.js)

Viewed 7808
<!DOCTYPE html>
<html>
<body>

<script crossorigin src="https://unpkg.com/@daily-co/daily-js"></script>
<script>
  callFrame = window.DailyIframe.createFrame();
  callFrame.join({ url: 'https://your-team.daily.co/hello' })
</script>
</body>

This code is trying to display a video function by embedding. I need to convert this to jsx to add it to my webpage or find another way to create a video call using react.

4 Answers

As described in the daily-js docs

Install the daily-co node package.

npm install @daily-co/daily-js

Then create a component that uses it.

// webpack/node-style require
//
const DailyIframe = require('@daily-co/daily-js');
let callFrame = DailyIframe.wrap(MY_IFRAME);

// or, cutting-edge, super-whizzy import
//
import DailyIframe from '@daily-co/daily-js';
let callFrame = DailyIframe.wrap(MY_IFRAME);
Related