Skip to content
Advertisement

conditionnally render prop in html

Basically I am trying to set the closeModal prop when offline to true and else to closeModal. How do I achieve this ? I am using react-detect-offline and ant design.

        <Detector
                render={({ of }) => (
                    <ModalSelectMenu
                    {of ? closeModal = 'true' : closeModal = { closeModal }}
                        isModalVisible={isModalVisible}
                        history={history}   
                    />
                )}
            />

Advertisement

Answer

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement