I've just started using React, so I used the approach used normally in Javascript.
My approach in Javascript I have 6 forms and by using onClick on a span tag i shift the position of a particular form(shifting left and right by 540px) and display it in the div. All other form are located outside the div and I've set overflow : hidden so they are not visible. I just use document.getElementById.style.left = 540px in Javascript.
How can I do the same in ReactJS ? I've tried the same but it says
TypeError:document.getElementById(...) is null
so I used the approach used normally in Javascriptbut that's not how react works. You don't do direct DOM manipulation. You makeleftpart of your component's state instead.