This project was bootstrapped with Create React App.
npx create-react-app react-workshop-2022
cd react-workshop-2022
yarn start
App is now running at http://localhost:3000.
We are going to create an Euro BTC converter application
You can start from your own App from last week, or simply fetch the solution branch and start from there.
<Converter /> component that takes a cryptoName and a exchangeRate. We can drop the crash to zero after 5 seconds functionality along with our current exchangeRate logic. Use a hardcoded value for BTC exchangeRate, 995. You can also create a little box for each conversion so they can sit nice next to each other. The converter component has 2 input fields. The base euro and the one that is provided trough the cryptoName property. Also Add a second converter to our app for Ethereum $ETH with a 1.2 exchangeRate. You can actually Add as many as you want.<Converter /> a usuabillity problem. Allow the <Converter /> component to render some custom markup to render it at the top of the component.<Amount /> that takes a name (eg. “Euros”) prop.<Amount /> input to show a red outline for negative amounts.<Amount /> a controlled component (ie. pass it its value as a prop).<Amount /> component that shows $BTC instead of Euros; use this function to get the exchange rate:
function exchangeRate() {
return Math.random() * 10000;
}
Help:
(Context API described using React class components) https://reactjs.org/docs/context.html
(useContext hook and how to use it in functional components) https://reactjs.org/docs/hooks-reference.html#usecontext