-3

carousel.js is my JavaScript code.Its purpose is to add Events like previous and next on a carousel.How should I use it in my TypeScript??

Down below is the render method where I have used some basic HTML.

  public render(): React.ReactElement<IReactCarouselProps> {

return (
   <div className={styles.image_carousel}>
        <div className={styles.inner}>
            <img className={styles.img} src="1.jpeg"/>
            <img className={styles.img} src="2.jpeg"/>
            <img className={styles.img} src="3.jpeg"/>
        </div>
        <div className={styles.bubbles}></div>
        <div className={styles.prev}></div>
        <div className={styles.next}></div>
   </div>


   );
}
c69
  • 19,951
  • 7
  • 52
  • 82
  • 2
    What is carousel.js? This isn't enough information for anyone to help you. What does carousel.js do? If it is an IIFE that returns an object you will need to assign the object to a variable in local scope and use it. – instantaphex Jul 24 '18 at 15:59
  • carousel.js is simple JavaScript coding to add Events like previous and next on a carousel – avinash tayal Jul 24 '18 at 17:07
  • 1
    Possible duplicate of [javascript require doesn't work inside html](https://stackoverflow.com/questions/50011068/javascript-require-doesnt-work-inside-html) – Heretic Monkey Jul 24 '18 at 17:14

1 Answers1

0

You should not add JavaScripts into your TypeScript file.

To get the work done, find a similar reference in TypeScript, as you want to have carousel, below are some npm packages which you can include.