Closed smercadomx closed 5 years ago
Is there a way to get all the props in a custom validator defined inside a shape:
static propTypes = { prop1: PropTypes.string, myShape: PropTypes.shape({ prop2: (props, propName, componentName) => { // props only contains the props declared inside the shape console.log(props); }, prop3: PropTypes.string }) }
myShape: (allProps, ...rest) => { return PropTypes.shape({ prop2: (props, propName, componentName) => { console.log(allProps, props); }, })(allProps, ...rest); },
great, thanks!
Is there a way to get all the props in a custom validator defined inside a shape: