Comments (2)
This is resolved in #614 which was opened in Oct 2021 so I'm not optimistic it'll get merged any time soon.
As a workaround adding the following module augmentation file (within a directory specified in your tsconfig.json
's compilerOptions.typeRoots
list – see the docs) will resolve the all-props-are-required type issues:
// react-native-modal.d.ts
import type React from 'react';
import type { ModalProps } from 'react-native-modal';
declare module 'react-native-modal' {
const Modal: React.ClassicComponentClass<Partial<ModalProps> & { children: ModalProps['children'] }>;
export default Modal;
}
from react-native-modal.
This is resolved in #614 which was opened in Oct 2021 so I'm not optimistic it'll get merged any time soon.
As a workaround adding the following module augmentation file (within a directory specified in your
tsconfig.json
'scompilerOptions.typeRoots
list – see the docs) will resolve the all-props-are-required type issues:// react-native-modal.d.ts import type React from 'react'; import type { ModalProps } from 'react-native-modal'; declare module 'react-native-modal' { const Modal: React.ClassicComponentClass<Partial<ModalProps> & { children: ModalProps['children'] }>; export default Modal; }
Thanks, you save my life!
I rewrite it without the 2024 deprecated clases
// react-native-modal.d.ts
import React from 'react';
import type { ModalProps } from 'react-native-modal';
type PartialProps = Partial<ModalProps> & {
children: ModalProps['children'];
};
declare module 'react-native-modal' {
const Modal: (Props: PartialProps) => React.ReactNode;
export default Modal;
}
from react-native-modal.
Related Issues (20)
- TypeError: _reactNative.InteractionManager.clearInteractionHandle is not a function HOT 1
- Android: Modal Pops up even if you're on a different screen
- Asking for Help: why the half-bottom-modal not reach the bottom in Android HOT 1
- Samsung One Ui is blocking modal when requested for android permission at same time.
- The application crashes when the component is unmounted, caused by the fact that DeviceEventEmitter does not recognize that it has the removeListener method. HOT 3
- Jest test cases not working with react-native-modal HOT 1
- Press events no longer propagating to children after Expo 49 upgrade HOT 1
- BackHandler is not supported on web and should not be used HOT 2
- Loading the modal on first render of screen means backdrop doesn't show
- react native modal keyboad open i want once backbutton pressed to close the keyboard and the modal at the same time
- react native modal keyboad open i want once backbutton pressed to close the keyboard and the modal at the same time onBackdropPress working
- Brief comments on the purpose of your changes: HOT 1
- Modal Animation Issue: Brief Left-to-Bottom Transition on Android/iOS HOT 2
- App freezes on clicking of outside of the content (backdrop) after orientation changes in ipad
- modal still showing when set to false when from prev screen , when nav back showing modal HOT 1
- Images do not have 'received' attribute
- TV remote focus is not coming in the Modal
- Animation jerky when opening
- Unable to scroll parent component if modal is open
- removeListener is not a function in production HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-modal.