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

Additional props for photo #212

Open
MiliusCZ opened this issue Dec 8, 2021 · 0 comments
Open

Additional props for photo #212

MiliusCZ opened this issue Dec 8, 2021 · 0 comments

Comments

@MiliusCZ
Copy link

MiliusCZ commented Dec 8, 2021

I'd like to pass some extra properties for my photo into renderImage function. The renderImage accepts props of type

RenderImageProps<CustomPhotoProps extends object = {}>

but if I try to define my renderImage method like this:

const imageRenderer: React.FC<RenderImageProps<CustomImageProps> = ({ photo, index }) => { ... }

I get the error from Gallery component that renderImage function has incompatible props. What is the proper way to pass additional props to renderImage function?

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

1 participant