react-key-navigation icon indicating copy to clipboard operation
react-key-navigation copied to clipboard

Navigation problem after route

Open TavenCFC opened this issue 7 years ago • 3 comments

Hello! I have a problem with navigation, after route from one component to another. After my app has loaded, I do an authorization check, then I route to another component.

componentWillMount() { this.props.Auth().then(() => { if (this.props.needSignUp) { this.props.history.push({pathname: '/signup/'}) } }) }

In the signup component, I have an Focusable elements

<div> <Focusable>Button-1</Focusable> <Focusable>Button-2</Focusable> </div>

When I trying to navigate this element, I get an error:

index.js:952 Uncaught TypeError: Cannot read property 'getNextFocusFrom' of undefined at Navigation.focusNext (index.js:952) at Navigation._this.onKeyDown (index.js:917)

What could be the reason?

TavenCFC avatar Nov 29 '18 15:11 TavenCFC

Also, if I just open the signup component, without route, the navigation works.

TavenCFC avatar Nov 29 '18 15:11 TavenCFC

I have the same problem. Have you checked resolve?

pahonski avatar Mar 18 '19 18:03 pahonski

Can you guys give me an example in http://codesandbox.io?

dead avatar Mar 18 '19 19:03 dead