livekit-dgn/lib/Debug.tsx
lukasIO cf7d8890c1
Use components (#6)
* Add link to components to README

* use components meet version

* update readme

* fix index styles

* update components

* update components

* update components
2023-01-19 19:56:00 +01:00

22 lines
480 B
TypeScript

import * as React from 'react';
import { useRoomContext } from '@livekit/components-react';
import { setLogLevel } from 'livekit-client';
export const useDebugMode = () => {
setLogLevel('debug');
const room = useRoomContext();
React.useEffect(() => {
// @ts-expect-error
window.__lk_room = room;
return () => {
// @ts-expect-error
window.__lk_room = undefined;
};
});
};
export const DebugMode = () => {
useDebugMode();
return <></>;
};