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

How to add classname to <Image> component #71

Closed
muhammadyana opened this issue Aug 17, 2020 · 1 comment
Closed

How to add classname to <Image> component #71

muhammadyana opened this issue Aug 17, 2020 · 1 comment

Comments

@muhammadyana
Copy link

i've try to add className in <Image> component, but it doesn't work. here my code
<Image
src={this.props.imageUrl}
fallback={<Shimmer width={800} height={600} />}
className={this.props.className}
/>

@gokcan
Copy link
Owner

gokcan commented Aug 17, 2020

You should use NativeImgProps:

<Image
   src={this.props.imageUrl}
   fallback={<Shimmer width={800} height={600} />}
   NativeImgProps={{ className: this.props.className }}
/>

@gokcan gokcan changed the title How to add class name to <Image> Component How to add classname to <Image> component Jul 27, 2021
@gokcan gokcan pinned this issue Jul 27, 2021
@gokcan gokcan changed the title How to add classname to <Image> component How to add classname to <Image> component Jul 27, 2021
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

2 participants