An alternative to fix Can only bind to an Identifier or MemberExpressionsvelte
?
#12826
Unanswered
frederikhors
asked this question in
Q&A
Replies: 1 comment 5 replies
-
This code works as is, I'm assuming you actually tried to use this instead: <AgeSelector bind:age={filters.playerAge?.gt} /> The most common way around this is to expose and use an event for change propagation instead of the binding. <AgeSelector
age={filters.playerAge?.gt}
onAgeChange={newAge => {
if (filters.playerAge == null) return;
filters.playerAge.gt = newAge;
}} /> |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Until now I was using this code:
Now the code changed like this:
and obviously I'm getting this error from Svelte:
Can you please suggest a way to fix this?
Beta Was this translation helpful? Give feedback.
All reactions