question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need help with "Warning: getRouteProps could not find..."

See original GitHub issue

I’ve got a problem only on development mode with the client-side navigation. I can access localhost:3000/tom directly but i can’t navigate from localhost:3000/john to localhost:3000/tom for example.

Any ideas ?

// static.config.js

export default {
  getSiteProps: () => ({}),
  getRoutes: async () => {
    return [
      {
        path: '/john',
        component: 'src/containers/Hi',
        getProps: async () => ({
          name: 'john'
        })
      },
      {
        path: '/tom',
        component: 'src/containers/Hi',
        getProps: async () => ({
          name: 'tom'
        })
      },
    ]
  },
}
// src/containers/Hi.js

import React from 'react'
import { getRouteProps } from 'react-static'

export default getRouteProps(({ name }) => (
  <div>
    <h1>Hi {name} !</h1>
  </div>
))

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DevSidecommented, Dec 21, 2017

Looks like because the prefetch is done on componentWillMount but not on componentWillReceiveProps. I use the same container. What do you think ?

0reactions
tannerlinsleycommented, Dec 21, 2017

Fixed with #255. Release is queued 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to import the types of react-dropzone?
I'm using react-dropzone with typescript, but I don't know how to import the types off ... I could not find it in the...
Read more >
Beginner friendly docs · Issue #263 · downshift-js ...
I wanted to bring attention to something I've experienced when integrating this component into the app I'm building.
Read more >
react-dropzone - npm
Warning : On most recent browsers versions, the files given by onDrop won't have properties path or fullPath , see this SO question...
Read more >
react-dropzone
Simple React hook to create a HTML5-compliant drag'n'drop zone for files. Documentation and examples at https://react-dropzone.js.org.
Read more >
How To Drag and Drop Files in React Applications with ...
In this article you will learn how to easily add a drop zone for files in React projects with react-dropzone. We will see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found