The renderElement function should be converted to a component prop so as ShouldRender component render it correctly when the condition is true. Otherwise, the function is being evaluated i.e the component that it is returned without the respecting the condition's value.
The
renderElement
function should be converted to a component prop so asShouldRender
component render it correctly when the condition is true. Otherwise, the function is being evaluated i.e the component that it is returned without the respecting the condition's value.