How to use the react-static.cleanPath function in react-static

To help you get started, we’ve selected a few react-static examples, based on popular ways it is used in public projects.

github JoshClose / CsvHelper / test / react-static-routes.js View on Github external
<Route path='*' render={props => {
        let Comp = getComponentForPath(cleanPath(props.location.pathname))
        let is404 = props.location.pathname === '404'
        if (!Comp) {
          is404 = true
          Comp = getComponentForPath('404')
        }
        return Comp ? <Comp {...props} {...(is404 ? {is404: true} : {})} /> : null
      }} />
    )
github JoshClose / CsvHelper / docs / react-static-routes.js View on Github external
const getComponentForPath = path => {
  path = cleanPath(path)
  return global.componentsByTemplateID[global.templateIDsByPath[path]]
}
github go-faast / faast-web / dist / react-static-routes.js View on Github external
const getComponentForPath = path => {
  path = cleanPath(path)
  return global.componentsByTemplateID[global.templateIDsByPath[path]]
}
github JoshClose / CsvHelper / docs-src / docs / public / old / 2.x / react-static-routes.js View on Github external
const getComponentForPath = path => {
  path = cleanPath(path)
  return global.componentsByTemplateID[global.templateIDsByPath[path]]
}