react-scroll icon indicating copy to clipboard operation
react-scroll copied to clipboard

Using with react-router's Link component

Open c0dester opened this issue 6 years ago • 4 comments

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?

c0dester avatar Jan 12 '18 12:01 c0dester

Did you find a solution to this?

(note to @1yzo )

Noitidart avatar Jun 23 '18 06:06 Noitidart

@c0dester Did you ever solve this?

colinwilson avatar Nov 02 '19 21:11 colinwilson

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.

fisshy avatar Nov 04 '19 06:11 fisshy

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

c0dester avatar Nov 17 '19 23:11 c0dester