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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more