-
-
Notifications
You must be signed in to change notification settings - Fork 348
Prop validation throws a warning still an issue. Related to closed ticket #70 #142
Comments
@mromanoff did you find any solution to this warning? |
@SagiMedina sorry but i did not find any solution. for now I ignore this message. |
@mromanoff @SagiMedina just tried to reproduce this issue, but it worked for me without warnings. Could you setup a small reproduction? Are you using the latest |
@mweststrate thank you for quick response. Due complexity of this project I'm working on and running on local environment only. I can send you link to public repo if this helps. Currently I have 4 warning messages:
i'm using mobx-react@3.5.8 |
@mweststrate Please take a look here, /~https://github.com/SagiMedina/system_dashboard |
Never mind, adding the wrappedComponent to the props validation fixed it. |
@mromanoff you still seem to attach the propTypes to Search, so the warning is correct? /~https://github.com/therapymatch/therapymatch-fe/blob/e1e90d6b48b1fd80fb9fd6d6e3d330d7057ea2d6/src/components/Search/Search.js#L60 |
That being said, |
This change forward writes (but not reads!) of `propTypes` and `defaultProps` on an inject based HoC to the wrapped component, so that propTypes and defaultProps can be defined in a straight forward way.
@mweststrate oh... my assumption was that I need to use .wrappedComponent only for "inject", "observer" store props but not for the other props. route props etc. I had before:
I have now:
the warning message gone. |
I've made the distinction between HoC's and non-HoC's more clear in |
4.0.0 has been released :) |
Related to: Prop validation throws a warning when used on a decorated component expecting store #70
@mweststrate i followed your last post on this topic. and still getting warning.
Mobx Injector: you are trying to attach propTypes to HOC instead of Actions. Use
wrappedComponent
property.here is my component:
am i missing something?
btw I'm using Babel
The text was updated successfully, but these errors were encountered: