Closed mayacode closed 6 years ago
In your static propTypes
block you have accessPeriodFrom: instanceOf(momentProps.momentObj)
. I'm not sure what the purpose of having instanceOf
is supposed to do here. It looks like it would prevent passing the actual propType.
Can you change to:
static propTypes = {
accessPeriodFrom: momentProps.momentObj,
accessPeriodTo: momentProps.momentObj,
};
and see if it fixes your problem?
Haven't heard back since April and I'm unable to reproduce or reject my hypothesis without more info.
Closing for now. If my suggestion didn't fix it or you're able to give more details feel free to clone or re-open?
Hi,
I just added moment and moment props to my project and am facing an error:
Failed prop type: Invalid prop 'prop1' of type 'Object' supplied to 'Component1', expected instance of 'bound propValidator'.
dependencies:
code:
As long as dates come as null or undefined everything is OK, in moment, when fetching data gives result and to component come moment objects (I check them with
moment().isMoment()
in container, from which they are passed to dumb Component1) I see the error.