Skip to content

Show and hide with CSS animation

My goal is to create an animation when showing and hiding an HTML element. The show and hide is triggered by a button that toggles a class hide. Here is my code: Answer just remove the display: block from your hide and if you want animated went div show add the animation too:

Can a some() function replace nested forEach()?

I need to replace two (nested) forEach loops with a some function. The purpose of the code block is to check if the [1] elements in arrayOne are within the max & min of arrayTwo. The code currently works fine and looks like this: Let me know if it isn’t clear enough. Really appreciate your help. Ans…

how to use value of useState after init it

I these state hook: my medicalProblem variable will initial with response of a api : but I got this error: Answer There are a couple ways to accomplish this, but the easiest may be creating another useEffect hook that depends on the medicalProblems array as seen below! That extra hook will make sure your medi…