MCPcopy Create free account
hub / github.com/decaporg/decap-cms / RouteInCollection

Function RouteInCollection

packages/decap-cms-core/src/components/App/App.js:58–69  ·  view source on GitHub ↗
({ collections, render, ...props })

Source from the content-addressed store, hash-verified

56}
57
58function 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
71class App extends React.Component {
72 static propTypes = {

Callers

nothing calls this directly

Calls 3

getDefaultPathFunction · 0.85
renderFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected