DEV Community

Sheikh Abdur Rohit
Sheikh Abdur Rohit

Posted on

Working with useState().

This is the code screenshot of a js file where I used the useState function. The problem statement was - If the text message entered is valid (for this example: if it's at least 3 characters long), the text "Valid message" should be displayed below the input field. If it's invalid (i.e., shorter than 3 characters), the text "Invalid message" should be displayed.

Image description

Code-Sandbox link: https://t.co/yeRO0UH0GO

Top comments (0)