question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript can't find Slider

See original GitHub issue

TYPESCRIPT - yay.

I’m currently required to use TS in my project but I can’t seem to find any documentation about it.

in node_modules/@types/react-slick there is a definition file which seems to extend React.Component and export Slider

export default Slider;

but Slider isn’t available as a namespace or an interface.

Can anyone offer any insight into getting this working? Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
john20xdoecommented, Jan 7, 2021

Another variation to get this to work, after installing @types/react-slick in devDependencies:

in your .d.ts file:

import Slider, { Settings } from 'react-slick';
declare module 'react-slick' {
  export { Slider, Settings };
}

then import normally in your component.

import Slider, {Settings} from 'react-slick';

VS Code Go To Definition will now go correctly to the node_modules index.d.ts.

1reaction
oxodesigncommented, Aug 15, 2019

Did you install @types/react-slick ? (Additional NPM package)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Property 'noUiSlider' does not exist on type 'HTMLElement'
Based on the linked d.ts it seems that you need to do: var slider: noUiSlider.Instance = document.getElementById('slider') as noUislider.
Read more >
@material/slider - npm
Sliders allow users to make selections from a range of values. The MDC Slider implementation supports both single point sliders (one thumb) and ......
Read more >
React Slider with Material UI and Typescript - YouTube
React Slider with Final Space API. Using React JS, Typescript and Material UI React.This is a video on how to use data from...
Read more >
JET In Typescript - Oracle
JET's Typescript type definitions are bundled with the JET npm package. ... You can see the generic parameter details of component under ...
Read more >
Could not find a declaration file for third party modules
I am working on a project with typescript (generated with vue cli 3.0). ... not find a declaration file for module 'vue-slider-component'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found