Skip to content
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

matches property of components overrides global Element.matches #226

Closed
anqurvanillapy opened this issue Aug 15, 2017 · 2 comments
Closed

Comments

@anqurvanillapy
Copy link

  • I was using swiper.js and its core library uses Element.matches for some selecting mechanism, and <Match />'s matches property overrides this, raising type error matches is not a function that it took me about 1 hr to realize that it was naming pollution
  • My solution is wrapping all my components into another big one (before this I used a <main/> plain HTML element with path property), and giving the top-level component a path property for the router and it worked well
  • Maybe this issue could be taken into further account, because the stacktrace of naming pollution in some debuggers like DevTools is not that informative
@developit
Copy link
Member

Hi @anqurvanillapy - definitely a strange error! I think we can have Router check if the child it is rendering is an HTML element and avoid passing down any of the URL matches in that case.

@developit
Copy link
Member

Are you able to provide a sample of the broken JSX? I'm trying to make sure I covered this case in #231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants