Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should re-render on re-assigning of tracked object #4

Open
joelmoss opened this issue Feb 24, 2022 · 0 comments
Open

should re-render on re-assigning of tracked object #4

joelmoss opened this issue Feb 24, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@joelmoss
Copy link
Owner

joelmoss commented Feb 24, 2022

Right now, when re-assigning an object with a new value, ibiza will not re-render, as the new value is not tracked.

See

ibiza/test/use_ibiza.test.jsx

Lines 1197 to 1219 in 2f1cf4c

it.skip('should re-render on re-assigning of tracked object', () => {
let renderCount = 0
store.debug = true
store.state.params = { name: 'Joel' }
const App = () => {
renderCount++
const state = useIbiza()
return <>[{state.params ? 'True' : 'False'}]</>
}
render(<App />)
screen.getByText('[True]')
expect(renderCount).toBe(1)
act(() => {
store.state.params = null
})
screen.getByText('[False]')
expect(renderCount).toBe(2)
})
})

@joelmoss joelmoss added the bug Something isn't working label Feb 24, 2022
joelmoss added a commit that referenced this issue Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant