enter image description here
i have to create a component where one person can add upto 4 addresses for doing this i have used slice(0,4) in map function but i have to make button disabled when 4 addresses are entered
How can i do this i need a solution
>Solution :
if(locations.length < 4) { <button type="button"> Add </button> }
So basically the button will appear or dissapear based on if the condition is true or false.