Hiding Navigation Buttons not working
eduardodomingos opened this issue · 1 comments
eduardodomingos commented
Describe the bug
Passing buttonPrev and buttonNext as null is not preventing them to be rendered.
Expected behavior
Hide navigation buttons if passed as null.
How to reproduce
<Lightbox
open={lightboxIsOpen}
close={() => {
setLightboxIsOpen(!lightboxIsOpen)
lightboxId && document.body.classList.remove(`lightbox-${lightboxId}-is-open`)
}}
slides={[
{ src: picture.urlOriginal }
]}
carousel={{ finite: true }}
render={{
buttonPrev: null,
buttonNext: null,
}}
/>
Screenshots / Logs
No response
Additional context
No response
igordanchenko commented
You are supplying invalid values for the buttonPrev
and buttonNext
props.
To hide the navigation buttons, you are supposed to provide a function returning null
in the buttonPrev
and buttonNext
render props
render={{
buttonPrev: () => null,
buttonNext: () => null,
}}
https://yet-another-react-lightbox.com/customization#HidingNavigationButtons