A starter kit for react serverside rendering applications
- Prerender Method { getInitialBeforeRender } on view components
- ES6 Support
- Redux Support
- eslint Support
- Server Side Rendering
- Babel
- React
- Redux
- Redux-thunk
- Redux-Promise
- PostCSS
- Express
- Hot Module Replacement
> $ npm install
Build and open your browser to http://localhost:8080.
> $ npm start
> $ npm run build
sample Home component for static declaration of data requirements
function Home({ data, input }) {
return (
<div>
<Helmet encodeSpecialCharacters>
<title>React ServerSideRendering</title>
</Helmet>
<div className={styles.intro}>
{data &&
data.map(array => {
return (
<div key={`array-${array.id}`}>
<h2>{array.title}</h2>
<p>{array.body}</p>
</div>
);
})}
</div>
</div>
);
}
Home.getInitialBeforeRender = () => InitialAction(); // static declaration of data requirements
function mapStateToProps(state) {
const { sample } = state.sampleReducer;
return {
data: sample && sample.data
};
}
export default connect(mapStateToProps, null)(Home);
Please file an issue if you find a bug, or need help.
- Code Splitting
The MIT License (MIT)
Copyright (c) 2023 Anish M Prasad