Created
June 30, 2020 11:28
-
-
Save alexmochu/c16adc68991a93cec8e30b208f075d1f to your computer and use it in GitHub Desktop.
Setup App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { useSelector, useDispatch } from 'react-redux'; | |
import logo from './logo.svg'; | |
import increment, { incrementAsync, decrement } from './actions'; | |
import Counter from './Counter'; | |
import './App.css'; | |
function App() { | |
const dispatch = useDispatch(); | |
const counter = useSelector(state => state.count) | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<Counter | |
value={counter} | |
onIncrement={() => dispatch(increment())} | |
onDecrement={() => dispatch(decrement())} | |
onIncrementAsync={() => dispatch(incrementAsync())} | |
/> | |
<p> | |
Edit <code>src/App.js</code> and save to reload. | |
</p> | |
<div> | |
Learn | |
{" "} | |
<a | |
className="App-link" | |
href="https://reactjs.org" | |
target="_blank" | |
rel="noopener noreferrer" | |
> | |
React, | |
</a> | |
{" "} | |
<a | |
className="App-link" | |
href="https://reactjs.org" | |
target="_blank" | |
rel="noopener noreferrer" | |
> | |
Redux, | |
</a> | |
{" "} | |
<a | |
className="App-link" | |
href="https://reactjs.org" | |
target="_blank" | |
rel="noopener noreferrer" | |
> | |
React Redux | |
</a> | |
{" "} | |
and | |
{" "} | |
<a | |
className="App-link" | |
href="https://reactjs.org" | |
target="_blank" | |
rel="noopener noreferrer" | |
> | |
Redux Saga | |
</a> | |
</div> | |
</header> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment