Create a component that allows users to add and remove tags dynamically.
MediumProblem Statement
Create a component that allows users to add and remove tags dynamically.
Sample Input
Initial tags: ["React", "JavaScript"]
Sample Output
Users can add a new tag or remove an existing one by clicking a delete button next to it.
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React, { useState } from "react"; const TagManager = () => { return ( <div> <ul> {/* Render tags */} </ul> <input type="text" /> <button>Add Tag</button> </div> ); }; export default TagManager;