Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can icons props be optionnal? #229

Closed
DryDemon opened this issue Mar 9, 2021 · 9 comments
Closed

Can icons props be optionnal? #229

DryDemon opened this issue Mar 9, 2021 · 9 comments

Comments

@DryDemon
Copy link

DryDemon commented Mar 9, 2021

on line 122 in index.d.ts there is the icon props
icons: { search: { name: string size: number } ....
Is it possible to set icons as an optional variable? I don't need to change the default setting.
icons: { to icons?: {

@itzfeltrin
Copy link

itzfeltrin commented Mar 22, 2021

yes, please. also, the 'IconRenderer' prop expects a function when it should be just an element. it works fine like this, but the error is annoying me :x
image

@renrizzolo
Copy link
Owner

Is this wrong? What should it be?

IconRenderer?: (() => void) | JSX.Element

@itzfeltrin
Copy link

I don't know, really, just got started with ts. maybe something changed with rn-vector-icons?. I will take a look into that later. anyway, I'd appreciate if you could make the icons prop optional :)

@itzfeltrin
Copy link

adding React.ReactNode to the IconRenderer prop makes the error go away, I don't know if it's a good solution tho
image

@scousino
Copy link

the real issue is with the icons prop, not the IconRenderer prop. icons is currently listed as a required prop, but it isn't required, since a default is available.

@scousino
Copy link

To clarify the IconRenderer typescript error is also valid, just not what the original poster was opening the issue about.

JimTeva added a commit to JimTeva/react-native-sectioned-multi-select that referenced this issue Dec 10, 2021
Trying to fix both issues listed here: renrizzolo#229
@JimTeva
Copy link
Contributor

JimTeva commented Dec 10, 2021

@renrizzolo , please check #253

@renrizzolo
Copy link
Owner

Both issues should be ixed in v0.8.2, please re-open if it persists.

@jonrainier
Copy link

9cc4df7#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8L124

Looks like these changes were reverted in this commit. Not sure if it's intentional or not, but I'm running into the same issues previously mentioned in this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants