Relay introduces two new classes of objects: RelayContainer and Relay.Route. Relay.PropTypes provides prop validators used to assert that props are of these types.
Properties
static Container: ReactPropTypeValidator A prop type validator asserting that a prop is a valid Relay container. static QueryConfig: ReactPropTypeValidator A prop type validator asserting that a prop is a valid route.
class MyApplication extends React.Component {
static propTypes = {
// Warns if `Component` is not a valid RelayContainer.
Component: Relay.PropTypes.Container.isRequired,
// Warns if `route` is not a valid route.
route: Relay.PropTypes.QueryConfig.isRequired,
};
render() {
return (
<Relay.RootContainer
Component={this.props.Component}
route={this.props.route}
/>
);
}
}
© 2013–present Facebook Inc.
Licensed under the BSD License.
https://facebook.github.io/relay/docs/api-reference-relay-proptypes.html