We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$state
NaN
When setting state with NaN it causes an update even though NaN is the same value as before.
<script> let x = $state(NaN); </script> <button onclick={() => { x = NaN }}>Set NaN</button> {#key x} <iframe title="Svelte" src="https://svelte.dev"></iframe> {/key}
Playground
Svelte should either switch to using Object.is for default equality or it should provide a way of supplying a custom equals function.
Object.is
equals
would make my life easier
The text was updated successfully, but these errors were encountered:
Closing as duplicate of #10061
Sorry, something went wrong.
No branches or pull requests
Describe the problem
When setting state with
NaN
it causes an update even thoughNaN
is the same value as before.Playground
Describe the proposed solution
Svelte should either switch to using
Object.is
for default equality or it should provide a way of supplying a customequals
function.Importance
would make my life easier
The text was updated successfully, but these errors were encountered: