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

Allow react components as message without react prop types error #34

Merged
merged 1 commit into from
Dec 4, 2018
Merged

Allow react components as message without react prop types error #34

merged 1 commit into from
Dec 4, 2018

Conversation

james-cordeiro
Copy link
Contributor

@james-cordeiro james-cordeiro commented Dec 3, 2018

You'll notice that the message param of enqueueSnackber allows react components such as <span>I am <strong>STRONG!</strong></span> to be passed in rather than just a string. It works perfectly fine too but a React prop invalidation error is thrown. This change stops that from happening.

@iamhosseindhv iamhosseindhv merged commit 26b613b into iamhosseindhv:master Dec 4, 2018
@iamhosseindhv
Copy link
Owner

Thanks for the contribution @james-cordeiro 👍🏼

@slavikdenis
Copy link

@iamhosseindhv could you fix ts types please to allow this? :) thank you

@iamhosseindhv
Copy link
Owner

this has been merged into master all be published in the next version release @slavikdenis

@slavikdenis
Copy link

Great, thanks :)

@iamhosseindhv
Copy link
Owner

Actually this has already been published. @slavikdenis

@slavikdenis
Copy link

slavikdenis commented Jan 11, 2019

Currently I am using "notistack": "^0.4.1" and the problem in index.d.ts is this
export interface InjectedNotistackProps { onPresentSnackbar: (variant: VariantType, message: string) => void; enqueueSnackbar: (message: string, options?: OptionsObject) => void; }

@slavikdenis
Copy link

Where it should be enqueueSnackbar: (message: React.ReactNode, options?: OptionsObject) => void;

@iamhosseindhv
Copy link
Owner

You're right @slavikdenis . This has been fixed in PR #40 and will be released in the next version.

@slavikdenis
Copy link

Oh I see! Great :)

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

Successfully merging this pull request may close these issues.

3 participants