Home > database >  Could not find a declaration file for module 'react-slick'
Could not find a declaration file for module 'react-slick'

Time:03-21

import Slider from "react-slick";

i have imported react slick also installed it.

import React, { useEffect, useRef,useState } from 'react';
import Slider from "react-slick";
import '../Styles/Work.css' ;
const Work = () => {
  
  return (
    <div style={{height:"100vh"}} ref={ref} className='work-container' id="work">
      <h1 ref={title} className='work-title'>
        MY WORKS
      {/* {inView && navigate('/#about')}   */}
      </h1>
    </div>
  )
}

export default Work

packagelock file

"react-scripts": "5.0.0",
"react-slick": "^0.28.1",
"react-slick-carousel": "^0.14.9",

it's displays in my package-lock too. what's the issue here?? i am using react with typescript

CodePudding user response:

You have to install the types for 'react-slick' @types/react-slick . Make sure its on your package.json as well as r@types/react 16.8.2

@types/react-dom

  • Related