I need to pass a parameter to the common function when my dom is loaded. I can’t use useEfect in my case. So I create a function for that. I need to check some parameters’ true and if it is true I return true or I return false.
export function validateUser(data) {
if (data==='order/view'){
return true
}
return false
}
export default validateUser();
return (
<div hidden={()=>{validateUser('order/view')}}> Som Data </div>
)
If div returns ‘order/view’ I need to show my div and if it’s not, I need to hide my div in my react site. But My method can’t return the parameters that I send it to.
If anyone can help me with that question, It really helps.