Home > OS >  React horizontal Scrolling Menu?
React horizontal Scrolling Menu?

Time:12-29

I am building a nextjs application. In my project I am not using TypeScript. I am using Javascript. I need a horizontal scroll on mouse wheel and also on touch. I haven't find any react packages. But I find one react package - react-horizontal-scrolling-menu. I see all demo. It perfect for my project. But I am facing one problem. Al of it's example create in TypeScript. But I am not using typeScript. If I copy the code, Then I get many error?

https://codesandbox.io/s/no-scrollbar-and-buttons-position-c3kn5?file=/src/index.tsx

In this situation, What I have to do. I am not understanding?

Please can anyone help me. I am facing this issue over 10 days. Please do not dislike or close my questions.

CodePudding user response:

You just need to get rid of every type definition of typescript. Every type in TypeScript is written after the variable name behind ":". So, in the codesandbox example, remove things like ": number" or ": void" at the end of functions.

Edit: im on mobile now, so i can't send you the Javascript code. The things you should look for are on line 17, 20 and 57. Hope the helps you.

CodePudding user response:

Converted to JavaScript. You only needed to remove types and change tsx, ts to jsx, js.

https://codesandbox.io/s/no-scrollbar-and-buttons-on-bottom-forked-m2wci

  • Related