import { useEffect, useRef } from "react"; import { observer } from "mobx-react-lite"; import { state } from "../state"; import { chartRef } from "./chartRef"; export const RenderInfoView = observer(function () { const info = state.renderInfo; const containerRef = useRef(null); useEffect(() => { const el = containerRef.current; if (!el) return; el.appendChild(chartRef.current); return () => { el.removeChild(chartRef.current); }; }, []); return <>
{info != null && (
draw: {info.calls} tri: {info.triangles} shaders: {info.shaders} geometries: {info.geometries} textures: {info.textures}
)} ; });