perf: json
This commit is contained in:
parent
14713797f1
commit
d0252bc9ff
|
@ -16,12 +16,12 @@ export default function Devtools({
|
|||
}) {
|
||||
const [ecs] = useEcs();
|
||||
const [mainEntity] = useMainEntity();
|
||||
const [mainEntityJson, setMainEntityJson] = useState({});
|
||||
const [mainEntityJson, setMainEntityJson] = useState('');
|
||||
useEcsTick(() => {
|
||||
if (!ecs || !mainEntity) {
|
||||
return;
|
||||
}
|
||||
setMainEntityJson(ecs.get(mainEntity).toJSON());
|
||||
setMainEntityJson(JSON.stringify(ecs.get(mainEntity), null, 2));
|
||||
}, [ecs, mainEntity]);
|
||||
return (
|
||||
<div className={styles.devtools}>
|
||||
|
@ -46,7 +46,7 @@ export default function Devtools({
|
|||
</label>
|
||||
</div>
|
||||
</form>
|
||||
<pre><code><small>{JSON.stringify(mainEntityJson, null, 2)}</small></code></pre>
|
||||
<pre><code><small>{mainEntityJson}</small></code></pre>
|
||||
</div>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
|
|
Loading…
Reference in New Issue
Block a user