Search code examples
node.jsdatabasereactjswebsocketcreate-react-app

Two Way Value Changing with Create React App


Title is a bit confusing, let me give you an example. enter image description here

2 Devices running on Network.

  1. Mobile
  2. Laptop

enter image description here If I type "Hello" on my mobile, How can I see the same thing on my Laptop environment (dynamically).

My Thinking:

Creating a JSON file with just one value in it and update it onChange of TextField.


Solution

  • You can't do such thing without implementing some sort of backend/database to maintain the communication between the two devices.

    As the comments said, you can use Socket.IO for example, or you can use GraphQL Subscriptions.

    That are many ways to do that, but if you don't want to implementing something like that from the zero, you will need to use some third-party software.