Skip to content

Instantly share code, notes, and snippets.

@cpv123
Last active August 16, 2020 01:22
Show Gist options
  • Save cpv123/5896c794d27fd81366f1cdeb5ee557a0 to your computer and use it in GitHub Desktop.
Save cpv123/5896c794d27fd81366f1cdeb5ee557a0 to your computer and use it in GitHub Desktop.
import React from 'react';
import ScriptLoader from 'react-render-props-script-loader';
import JitsiView from './JitsiView';
const JitsiContainer = props => {
// Prepare config e.g. user and room names
const userConfig = { ... }
const roomConfig = { ... }
return (
<ScriptLoader
type="text/javascript"
src="https://meet.jit.si/external_api.js"
>
{({ loading, error }) => {
if (error) return <ErrorState />;
if (loading) return <LoadingState />;
return (
<JitsiView
userConfig={userConfig}
roomConfig={roomConfig}
/>
)
}}
</ScriptLoader>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment