import { useEffect } from react
import { observer, $ } from 'teamplay'
const UserProfile = observer(({ userId }) => {
const $initialized = $.session.tables.userExample.initialized
const initialized = $initialized.get()
const $table = $.session.tables.userExample
// if (!$table.get()) $table.set({}) // line 1
useEffect(() => {
$table.schema.set([]) // line 2
setTimeout(() => {
$initialized.set(true)
}, 100)
}, [])
console.log('res:', initialized)
return <div>hello</div>>
})
Never show res:true in the console. but you can fix it either by commenting line2 or uncommenting line 1
Never show res:true in the console. but you can fix it either by commenting line2 or uncommenting line 1