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.

Couldn't find declaration file for 'react-native-animated-splash-screen'

See original GitHub issue

Issue Hello! I’ve recently installed the splash screen via Yarn, but when I try and import the AnimatedSplash component, this shows up on my IDE!

Could not find a declaration file for module 'react-native-animated-splash-screen'. 'c:/Users/moallim10/StuLink/stulink-app/node_modules/react-native-animated-splash-screen/index.js' implicitly has an 'any' type. Try npm install @types/react-native-animated-splash-screenif it exists or add a new declaration (.d.ts) file containingdeclare module ‘react-native-animated-splash-screen’;

This then doesn’t let me use the AnimatedSplash component properly!

Enviroment React Navigation V5 React Native 0.63 Expo SDK 38

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
alinzcommented, Oct 27, 2021

@moaIIim and for anyone needed the declaration:

create a file in your react-native folder called mytypes.d.ts and paste the following code:

declare module 'react-native-animated-splash-screen' {
  import React from 'react'

  interface Props {
    preload?: boolean
    logoWidth?: number
    logoHeight?: number
    backgroundColor?: string
    isLoaded: boolean
    disableBackgroundImage?: boolean
    logoImage?: string | number | object
    translucent?: boolean
    customComponent?: React.ReactNode
    disableAppScale?: boolean
    duration?: number
    delay?: number
    showStatusBar?: boolean

    children?: React.ReactNode
  }

  const props: React.FC<Props>
  export default props
}
0reactions
moaIIimcommented, Aug 27, 2020

Hello!

you could delete the node_modules and then run npm install once again, then you should invalidate cache and restart your IDE

Thank @pandumalik for the help.

you could delete the node_modules and then run npm install once again, then you should invalidate cache and restart your IDE

I’ve just tried this, and it still doesn’t work! image

@moallim10 I will add support to TypeScript declaration. Will be ready soon. Thanks!

Thanks for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module ''react-materialize ...
I'm unsure how to resolve this import statement to work with ts-loader and webpack. The index.js of react-materialize looks likes this. But how ......
Read more >
Troubleshooting | React Navigation
Troubleshooting. This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation.
Read more >
could not find a declaration file for module || React js solved
Hello guys, with short line of code this error will be solved.Subscribe this channel to get solution for the programmingError ...
Read more >
referenceerror can t find variable axios - metara.net
Runtime aspect of `HttpStatusCode` missing from JavaScript files. Basically the variable in Javascript can be anything that's valid according to ECMAScript 5.1 ...
Read more >
A Definitive React-Native Guide for React Developers
As you can see, you need to render a different component while you are loading the font (the splash screen would be perfect!),...
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