Last active
May 17, 2018 04:13
-
-
Save ioness/58ca25de1391a3be4b69798c3e71e56c to your computer and use it in GitHub Desktop.
redux_little_router_plus_create_react_app_problem
This file contains hidden or 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
// App.js | |
import React, { Component } from 'react' | |
import { Fragment } from 'redux-little-router' | |
import logo from './logo.svg' | |
import './App.css' | |
const pdf1 = require('./pdf/4-FOR-BANK-ACCOUNT.pdf') | |
const pdfProblema = require('./pdf/studentfy.pdf') | |
class App extends Component { | |
render () { | |
return ( | |
<Fragment forRoute='/'> | |
<div style={{ width: '100%' }}> | |
<Fragment forRoute='/'> | |
<div className="App"> | |
<a href={pdf1}>pdf</a> | |
<br/> | |
<a href={pdfProblema}>pdfProblema</a> | |
</div> | |
</Fragment> | |
<Fragment forRoute='/chao'> | |
<div className='App'>CHAO</div> | |
</Fragment> | |
</div> | |
</Fragment> | |
) | |
} | |
} | |
export default App |
This file contains hidden or 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
// index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
import { Provider } from 'react-redux' | |
import { combineReducers, compose, createStore, applyMiddleware } from 'redux' | |
import reducers from './reducers' | |
import { routerForBrowser } from 'redux-little-router' | |
const routes = { | |
'/': { | |
} | |
} | |
const { reducer, middleware, enhancer } = routerForBrowser({ | |
routes | |
}); | |
const clientOnlyStore = createStore( | |
combineReducers({ router: reducer, reducers }), | |
{}, | |
compose(enhancer, applyMiddleware(middleware)) | |
); | |
ReactDOM.render( | |
<Provider store={clientOnlyStore}> | |
<App /> | |
</Provider>, | |
document.getElementById('root') | |
); | |
registerServiceWorker(); |
This file contains hidden or 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
{ | |
test: [/\.pdf$/], | |
loader: require.resolve('url-loader'), | |
options: { | |
limit: 10000, | |
name: 'static/media/[name].[ext]', | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment