0

I am trying to fit this code on a TypeScript project, which is an adaptation of the react-custom-scrollbars.

Here is where I get lost with TypeScript, it needs type declaration for style and props, this is the one instance where I do not want TypeScript to do type checking since I know this code works, and I want to use it as a plugin.

Is there any way to deal with this type of situations?

https://codesandbox.io/s/react-hooks-with-typescript-forked-ntsfq?file=/src/index.tsx

1 Answer 1

1

You could use exclude config in tsconfig.json like

"exclude": ["node_modules", "**/*.my-file-to-exclude.ts", "**/*.my-js-file-to-exclude.js"]

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, will resort to that if I can not figure out how to defined the types as this is part of a file I actually want TypeScript to check, Do you know how I can defined the type for style and props in this example?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.