// example.jsx import { h, Fragment, render, mount, mountCallback } from '@/index'; const Depth4 = mount(() => { mountCallback(() => { console.log('MOUNT - Depth4'); return () => console.log('UNMOUNT - Depth4'); }); return () => (
depth4
); }); const Depth3 = mount(() => { mountCallback(() => { console.log('MOUNT - Depth3'); return () => console.log('UNMOUNT - Depth3'); }); return () => (
depth3
); }); const Depth2 = mount(() => { mountCallback(() => { console.log('MOUNT - Depth2'); return () => console.log('UNMOUNT - Depth2'); }); return () => (
depth2
); }); const Depth1 = mount(() => { mountCallback(() => { console.log('MOUNT - Depth1'); return () => console.log('UNMOUNT - Depth1'); }); return () => (
depth1
); }); const CallbackRoot = mount(renew => { let isShow = true; const toggle = () => { isShow = !isShow; renew(); }; return () => ( {isShow ? : null} ); }); const Root = ; //@ts-ignore window.root = Root; render(Root, document.getElementById('root'));