Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 979
Salil Rajkarnikar Avatar asked Mar 23 '26 05:03

Salil Rajkarnikar


1 Answers

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

like image 167
noobprogrammer Avatar answered Mar 25 '26 20:03

noobprogrammer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!