Skip to content

Instantly share code, notes, and snippets.

@kvnam

kvnam/App.js Secret

Last active October 10, 2018 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kvnam/77bf73d954d84053d5d10dcecf93b841 to your computer and use it in GitHub Desktop.
Save kvnam/77bf73d954d84053d5d10dcecf93b841 to your computer and use it in GitHub Desktop.
ReactPress App.js
import React, { Component } from 'react';
import { Route } from 'react-router-dom';
import { AnimatedSwitch } from 'react-router-transition';
import Navigation from './containers/Navigation/Navigation';
import Blog from './containers/Blog/Blog';
import SinglePost from './components/Post/SinglePost';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div>
<Navigation />
</div>
<AnimatedSwitch
atEnter={{opacity: 0}}
atLeave={{opacity: 0}}
atActive={{opacity: 1}}
className="switch-wrapper">
<Route path="/post" exact component={SinglePost} />
<Route path="/auth" exact render={() => <div>Signin Data</div>} />
<Route path="/" exact component={Blog}/>
</AnimatedSwitch>
</div>
);
}
}
export default App;
import axios from 'axios';
const axiosInstance = axios.create({
baseURL: 'http://dev.bluekrill.com/demoWP/wp-json'
});
export default axiosInstance;
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import PostReducer from './store/reducers/posts.reducer';
const appStore = createStore(appReducer, applyMiddleware(thunk));
const app = (
<BrowserRouter>
<Provider store={appStore}>
<App />
</Provider>
</BrowserRouter>
);
ReactDOM.render(app, document.getElementById('root'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment