expose Base component#86
Conversation
|
You don't need to do this; the component that must extend Base is created automatically by the factory* functions. You only need to extend Base if you want to completely overwrite the components without using the factories — but then you lose all of the functionality of react-validation itself for that component. |
|
I'm looking to use this with the react-select component (https://github.com/JedWatson/react-select) so it'd be easiest for me to create a wrapper component that handles the validation(i.e. registering the component with the form basically) for this react-select. |
|
Ah, I see. That looks like a pretty complex component; I assume that simply wrapping it with a selectFactory wouldn't be enough to handle its behaviour (e.g. like here: https://github.com/Lesha-spr/react-validation/blob/master/lib/src/components/Select/Select.jsx)? In which case, yes, exposing Base makes a lot of sense. |
Since form components must be of type:
components: PropTypes.objectOf(PropTypes.instanceOf(Base)),
it helps to expose Base.jsx to be able to compose custom components