Replies: 1 comment 1 reply
-
This is not reactive if !err().is_empty() { This would be reactive move || if !err().is_empty() { I'll be honest and say I didn't read through the rest in detail... examples with a lot of Tailwind baked in can be hard to process.
This doesn't sound right to me and could either be a bug or something else going wrong. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to make a TextField component which has some kind of validation and will be shown as an error textfield in case of an error.
First I implemented a normal text field component and then I implemented an error text field component, and then I implemented an interactive component using .
I got a problem because my textfield components were taking a lot of props and I could not reuse them in the fallback without cloning each prop and assigning them to new variable names.
I didn't like that so I tried just making an if else instead of the show, and put everything into the same function: here is an example
Now my problem is that the if/else only runs one time. So when my error state updates nothing changes.
I tried another implementation where I use Show in a smaller scope and then use dynamic classes, but since I have a lot of classes I would have to make a ton of checks:
Here is my latest implementation (which has an error that I cannot use space in the dynamic class):
I am using it like this:
Update
I just realized that I probably cannot do this because I want to use it in an actionform, and the actionform requires me to have all my input and buttons as pure html (not components) or else it will panic
Beta Was this translation helpful? Give feedback.
All reactions