Closed hosiawak closed 7 years ago
Yeah, React is more picky about props now. I agree the best approach would be to simply remove any custom props before creating the React component.
Should be fixed by this commit https://github.com/reagent-project/reagent-forms/commit/a57c85dc02c388b1d6d0412e9a53e8075b835823
Yes, it's fixed, thanks :)
@yogthos I have the same issue on version 0.5.28
with :field
Warning: Unknown prop `field` on <input> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
Looks like I missed a call to clean-attrs for some field. Any chance you could take a look?
Not in the near future
no worries I'll take a look when I get a chance
@viebel I just ran into the same issue, but it turns out my problem was that I was using
(defn form []
[:form ....])
instead of
(def form
[:form ...
¸¸¸
Not sure if that might be your problem, too, but I thought I'd better point it out.
I am also using a function but I need it in order to make my form configurable.
Here is the a klipse snippet that demonstrates my code: http://app.klipse.tech/?cljs_in.gist=viebel/e6978ad5f2682c301afce85d95089fe2&container
But Klipse uses a minified version of React. Therefore, there is no warning.
Is there a way to enables the warnings with React minified?
Using a function there should be fine. Since the function is evaluated before it's passed to bind-fields
. You just can't pass a function as a parameter, as bind-fields
uses postwalk
, and requires a data structure to walk.
Actually an interesting thing happens: When I use reagent-forms 0.5.28 from clojars, my code still has the fields property warning. But when I pull the master branch and reference its src folder in my :source-paths it works. So are you sure you the most recent version is at clojars?
Oh, I'm silly - my local checkout had a modification, so I guess that means I fixed the bug :) Pull request coming up
Perfect thanks, just pushed out a new version to Clojars with the fix. :)
I upgraded reagent to 0.6.0 and now getting warnings like:
react.inc.js:20209 Warning: Unknown prop
visible?on <div> tag. Remove this prop from the element
:field
appears too on container :divs. I guess React added some validation on props in 0.14 or later.If that's the case would removing these props after parsing in reagent-forms be a good solution ?