Sobes.tech
Junior — Middle+

Synchronous updating of input text in different browser tabs

livecode

Task condition

The application needs to implement a mechanism that maintains the same content of a text field across all open browser tabs. When text is entered or changed in one input, the corresponding value should automatically appear in similar fields on other tabs.

function App() {
  const [text, setText] = useState('');

  const handleChange = (value: string) => {
    setText(value);
  };

  return (
    <div className="app">
      <input onChange={(e) => handleChange(e.target.value)} />
    </div>
  );
}