-
-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anchor Link - Cannot read property 'props' of null #5129
Comments
@FacundoGFlores Ye,I think it possibly is a bug.But your solution miss some situations.e.g, For your solution,it will still cause error because the elements above don't have |
Yes, that's right. But we have to check child twice. First just for child and then for hrefs. |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
What did you do? Please provide steps to re-produce your problem.
Added conditional rendering to the link:
{props.show && <Link href="#foo" title="foo">}
What do you expected?
Just show the link when prop
show
istrue
What happen?
Error:
codepen
http://codepen.io/FacundoGFlores/pen/GWJdNK?editors=001
possible solution
I think it would be easy to solve it just adding:
var href = !!child ? child.props.href : null;
The text was updated successfully, but these errors were encountered: