Markdown Previewer(JQuery scroll method)

Hi,
i want to add a scroll effect to my previewer , i put the code in componentDidMount method , not working …

my code : https://codepen.io/camper94/pen/WNwLpov

First, it’s a very bad idea to mix two DOM handling libraries together (React + jQuery).
Second, what are you trying to achieve? Just calling .scroll() on an element won’t do anything. You should provide handler.

1 Like

you were right about it , i used CSS instead and it gives me the result that i was looking for i don’t know why i didn’t think to take this direction first ?? anyway thanks for the hint

so you recommend to use one of them but never both ?

If you know what you’re doing you can use how many frameworks/libraries you want on a single page, but each of them should still manage their own part of DOM (google “micro frontends”).