Router: component prop is not applied on Router

Created on 7 Jun 2018  路  13Comments  路  Source: reach/router

Hello,

when we pass a value to the Router's component prop, the node stays a div.

Repro : https://codesandbox.io/s/8n7xn1k7y9

bug

Most helpful comment

All 13 comments

You also have to set primary to false:

<Router component="main" primary={false}>

Thanks for your answer!

Is there a reason why the primary router can't be anything other than a div?

Doesn't look like it. Seems like the easiest thing is to pass along the component prop here. I'll see about a PR for that.

Just need to delete this line, I remember moving around the focus handling and missed that. If it's deleted it'll end up in domProps that will make it all the way down to the element.

I can do it, or you can send a PR.

https://github.com/reach/router/blob/2675f56127c921474b275ff91fbdad8ec33cbd74/src/index.js#L159

You still rely on it below:

https://github.com/reach/router/blob/2675f56127c921474b275ff91fbdad8ec33cbd74/src/index.js#L192

So, it's probably best to just pass it through so it's consistent in both places.

fixed in v1.0.8. Completely broken in 1.0.8, fixed in 1.0.9.

@ryanflorence 04c8ca5 just busted things, since component is no longer defined.

oh lol ... why was my linter not working?

See my comment above. You're referencing component, but haven't actually defined it.

Yeah yeah, shipping a fix rn

@timdorr looks good now?

mean ...

Was this page helpful?
0 / 5 - 0 ratings