({ collections, render, ...props })
| 56 | } |
| 57 | |
| 58 | function RouteInCollection({ collections, render, ...props }) { |
| 59 | const defaultPath = getDefaultPath(collections); |
| 60 | return ( |
| 61 | <Route |
| 62 | {...props} |
| 63 | render={routeProps => { |
| 64 | const collectionExists = collections.get(routeProps.match.params.name); |
| 65 | return collectionExists ? render(routeProps) : <Redirect to={defaultPath} />; |
| 66 | }} |
| 67 | /> |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | class App extends React.Component { |
| 72 | static propTypes = { |
nothing calls this directly
no test coverage detected