https://arek-starter.herokuapp.com/active
npm i
npm start
- Create new React button component (you can copy one of the existing). Let's call it
CounterButton
. Inside the button display a number of times that this button was clicked. Keep the the counter value in React state and modify it on every click by +1.
https://facebook.github.io/react/docs/hello-world.html
- Create a styled compontent that will wrap the value of
CounterButton
. Change the color of text to blue. - Change the styling depending on number of clicks. If the number of clicks is greater than 5 make the text red and bigger.
- Change the background of the
CounterButton
(only that button).
https://www.styled-components.com/
- Create next React button component and name it
ReduxCounter
. It should do the same asCounterButton
, but this time we will save it's value in redux store. (Pro tip: Install Redux DevTools for your browser. Working with Redux will be easier. Investigate how "ReduxButton" works.)
- Create links to "HOME" (path: "/") and "MY BUTTONS" (path: "/mybuttons"). Do it with React Router. Don't worry about styling.
- Render
CounterButton
andReduxCounter
only when url matches "/mybuttons". Other buttons can be still rendered.
https://reacttraining.com/react-router/
- Create new React button component and name it
GraphQLButton
. Apply the same functionality as before but this time save changes in database.