TextField Not Updating, Please help removing boilerplate #2066
Replies: 2 comments
-
I've looked through the binding basics case study. And, I've looked through the Q&A. Please tell me I'm just doing something wrong. In my root view, I only observe screen change. In this view, I only observe like 4 properties. I tried creating a viewstate to manage it and that didn't help. I tried ObservedObject. That didn't help. Unfortunately, there seems to be something wrong but I can't figure out what. The textfield literally puts in 1 character and then deletes that text. It seems like something is being called multiple times. I tried using removeDuplicates too. |
Beta Was this translation helpful? Give feedback.
-
Hey, @Senbazuru1075 ! When using // Reducer
public var body: some ReducerProtocol<State, Action> {
BindingReducer()
Reduce { state, action in
// Your reducer logic
// ...
}
}
// View
TextField("Enter Your Email", text: viewStore.binding(get: \.$userEmail)) Including |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I know this code is wonky. I'm still a beginner. I'd like help removing the boilerplate and actually getting the textfield to update. I considered doing shared computation, but I didn't know what to put there and had trouble access state because it captures a mutable inout parameter or something.
This code is reproducible. I use a neuromorphic style for my app so there are a fair amount of modifiers broken down in my utilities file. Using a normal textfield and vanilla swiftui updates the text in the textfield.
I know there is more to do with password stuff like using regex functions or something and also using apples security packages.
I'm just looking for help to remove boilerplate and take these two files to the next level if that's possible.
Beta Was this translation helpful? Give feedback.
All reactions