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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="theme-color" content="#000000" /> | |
<meta | |
name="description" | |
content="Web site created using create-react-app" |
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 {Helmet} from "react-helmet"; | |
function About() { | |
return ( | |
<div className="about"> | |
<Helmet> | |
<title>About - yoursite.com</title> | |
<meta name="description" content="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." /> | |
<link rel="canonical" href="http://mysite.com/example" /> |
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 { render } from 'react-dom' | |
import { Provider } from 'react-redux' | |
import CounterComponent from './containers/CounterComponent' | |
import store from './store' | |
render( | |
<Provider store={store}> | |
<CounterComponent /> | |
</Provider>, |
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 {applyMiddleware, createStore} from 'redux' | |
import logger from 'redux-logger' | |
import rootReducer from '../reducers' | |
const store = createStore(rootReducer, applyMiddleware( | |
logger | |
)) | |
export default store |
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
const initialState = { | |
count: 0, | |
} | |
function CounterReducer (state = initialState, action){ | |
switch(action.type){ | |
case "INCREMENT_COUNT": { | |
return {...state, ...action} | |
} | |
case "DECREMENT_COUNT": { |
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 {combineReducers} from 'redux' | |
import CounterReducer from '../reducers/CounterReducer' | |
export default combineReducers({ | |
counter: CounterReducer, | |
}) |
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
export const incrementCount = count => { | |
const num = count+1 | |
return { | |
type: 'INCREMENT_COUNT', | |
count: num | |
} | |
} | |
export const decrementCount = count => { | |
const num = count - 1 |