react-scroll
react-scroll copied to clipboard
Using with react-router's Link component
Hi!
I was looking for similar issue, but didn't find such one.
In my project I wanted to change route along with scrolling. I found useful HOC/mixin - ScrollLink. The case seemed to be easy, to just wrap react-router's Link with this hoc. But... react-router's Link doesn't receive to prop because of this code in ScrollLink:
for (var prop in protoTypes) {
if (props.hasOwnProperty(prop)) {
delete props[prop];
}
}
Is there chance to change code to pass desirabled props further?
Did you find a solution to this?
(note to @1yzo )
@c0dester Did you ever solve this?
On possible solution could be to add a prop to ScrollLink, that says whether or not to pass props down. Reason for not passing props down, was that you get a lot of warnings saying that the props did not exists on the given element.
You could also extend the ScrollLink class, and override the render method.
Sorry, I finished project before first response (23 Jun 2018) and didn't have opportunity to solve problem. I choosed other way that I don't remember now. Issue can be closed