In this post we will be setting up PowerApps Code Components(PCF) with React and TypeScript.
Prerequisites
Creating PCF component with React
1. To create a PCF component with React type the following command in VS Code inbuilt terminal(Press ctrl + `
to open)
pac pcf init --namespace OpenCodeBook --name MyFirstComponent --template field -fw react --run-npm-install
2. Once all packages are added type the following command to run your solution locally
npm start watch
3. A local development workbench will open where you can view and debug your component.

Code on GitHub: here
What’s Next?
OpenCodeBook.com