diff --git a/websites/visualization/src/app/react/useSyncExternalStore/page.tsx b/websites/visualization/src/app/react/useSyncExternalStore/page.tsx new file mode 100644 index 000000000..051129924 --- /dev/null +++ b/websites/visualization/src/app/react/useSyncExternalStore/page.tsx @@ -0,0 +1,41 @@ +'use client' +import React, { useState, useSyncExternalStore } from 'react' + +export default function Page() { + const [store] = useState(new Store()) + const state = useSyncExternalStore( + store.subscribe, + () => store.state, + () => store.state + ) + + console.log('render') + + return ( +