cbbfcd / react-native-lightbox

Images etc in Full Screen Lightbox Popovers for React Native
MIT License
63 stars 27 forks source link

Render item #9

Closed demedos closed 2 years ago

demedos commented 2 years ago

Based on https://github.com/cbbfcd/react-native-lightbox/pull/4, but based on the master branch.

Adds the renderItem method, which can be used to display a custom element instead of children. This is extremely useful for having a custom trigger element, e.g. a button above an image, and is fully backward compatible.

It also fixes the typescript return types of the renderHeader and renderContent methods, which should return a JSX.Element instead of void.

https://user-images.githubusercontent.com/16702156/153588340-954f4820-2c3b-4d6d-8dbb-7ca48ec77940.mov

demedos commented 2 years ago

@cbbfcd This also updates the dist folder which hasn't been updated with 0.9. Please note that when running the prepublish script there are a few typescript errors probably due to a wrong @types package version