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.

Why aren't "theme" props optional?

See original GitHub issue

I found a couple of instances of components where the theme prop is required. Is there a specific reason for this?

https://github.com/callstack/react-native-paper/blob/main/src/components/TextInput/TextInput.tsx#L133

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
pehcommented, Dec 23, 2021

The documentation states theme as optional and can only be fixed by downgrading to 4.9.2. It’s a bit annoying to bot be able to use the latest version without errors

0reactions
raajnadarcommented, Jan 23, 2022

There is already a PR waiting to get it merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Showing error whenever optional props are being sent to a ...
I am trying to optional have row-select features and this should be determined based on a prop that is being passed from parent....
Read more >
How To Customize React Components with Props
In this tutorial, you'll create custom components by passing props to your component. Props are arguments that you provide to a JSX element....
Read more >
Customization | React Native Elements
If you want to keep your styles outside the component use makeStyles() (hook generator) to reference the theme and component props (optional param)....
Read more >
Components and Props | React - ReScript
Basic concepts for components and props in ReScript & React. ... In JSX, you can apply optional props with some special syntax: ReScriptJS...
Read more >
React.js: Property is missing in type but required in type
... of the props the component requires, e.g. ` ` or mark its props as optional. ... so we aren't required to provide...
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