Fork me on GitHub
#fulcro
<
2019-03-26
>
mdhaney22:03:35

I would like to be able to use the Form State support with React Native, which doesn't currently work. The problem is that fulcro.ui.form-state requires fulcro.client.dom[-server], which breaks React Native. It appears the only place the DOM is used is in the FormConfig component, which is mainly used for its query but the comments state you can render it if that's helpful. Assuming people actually use this feature (rendering the FormConfig), I'm thinking we could work around by removing the rendering from the base FormConfig component, but have a rendering version of it in a separate namespace. I'm willing to do the work and submit a PR for this, I just wanted to get feedback first from @tony.kay, to make sure I'm not missing something or if he would like it fixed a different way.

felipethome22:03:53

Hi! I’m having a problem using the input element. If the fulcro wrap-form-element function is not used (turning it off with with-redefs [fulcro.client.dom/form-elements? (fn [_] controlled-by-fulcro?) and using fulcro.client.localized-dom/macro-create-element to create the input) and then we make a controlled input using a db value the cursor starts to go to the end of the input in every render. In other words if I erase a character in the middle the cursor goes to the end in the following render. I believe this is related to mismatches in the value property of the input element. I tried to use react state to make the input controlled and that worked (for what I see in wrap-form-element you are doing the same there). Why is that? I would like to know the reasoning behind wrap-form-element.

tony.kay23:03:27

this is a react behavior…which is why we have a special wrapper for it