Extend default props interface to support custom props (Typescript)
See original GitHub issueI have gone through these following points
- Check latest documentation: https://docs.nativebase.io/
- Check for existing open/closed issues for a possible duplicate before creating a new issue: https://github.com/GeekyAnts/NativeBase/issues
- Use the latest NativeBase release: https://github.com/GeekyAnts/NativeBase/releases
- Check examples from NativeBase KitchenSink https://github.com/GeekyAnts/NativeBase-KitchenSink
- For discussion purpose make use of NativeBase Slack: http://slack.nativebase.io/
- For queries related to theme, check Theme Variables from Docs and live NativeBase Theme Editor http://nativebase.io/customizer/
Issue Description
node, npm, react-native, react and native-base version, expo version if used, xcode version
- node - v8.12.0
- npm - 6.5.0
- react-native - 0.59
- native-base - 2.13.4
- expo - 33
- xcode - 10.2.1
Hi, thank you for you library, it’s awesome.
I am wondering if there is a way to customize current typescript interfaces to support my custom prop styles from theme
folder?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
Typing defaultProps - React TypeScript Cheatsheets
A component with defaultProps may seem to have some required props that actually aren't. Problem Statement. Here's what you want to do: interface...
Read more >Default Props in React/TypeScript - DEV Community
It seems to me that interfaces are the "default" TypeScript way to ... interface Props extends PropsWithChildren<any>{ requiredString: ...
Read more >How to extend a component to add default props in React/TS
You can do that by using the React.ComponentProps ¹ utility type to get the type of the props of DataGrid , and TypeScript's...
Read more >Use Interface Props in Functional Components ... - Pluralsight
Writing function or class components in a React/TypeScript app often requires you to define the type of props passed to them.
Read more >How to Overload TypeScript React Component Interfaces by ...
Bonus tip: A simple way to extend this to include unionized interface overloading to your custom props could be to follow a pattern...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For example I want to have a way to use this:
Without using
ts-ignore
above@mccordgh I solved this by using a similar pattern to @RioFiveJack, but extending the interface instead of overwriting it as my original solution did:
Is this the use case you’re looking for?