I am new to react. I need help with getting height of the coding
div. Here is the react code that I am working with as an example:
const buttonDiv = () => (
<div
className={styles.coding}
>
<button
className={styles.codingButton}
onClick={() => doSomething()}
>
Click Me
</button>
</div>
);
So let say styles.coding
class is coding
and styles.codingButton
is coding-button
. Then there is another div with the class of let say coding2
How would I use the react to check and see what height for example was set on coding
div.
Really what I am trying to do is translate this jquery to react
function dosomething() {
if($('.coding').height() > 0){
$('.coding').height('0')
$('.coding2').height('100%')
}
else {
$('.coding').height('50%')
$('.coding2').height('49%')
}
}