mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-01-09 05:26:58 -06:00
Merge pull request #88 from aleleba/PR-206472
PR-206472: fixing readme and adding text from redux store in initial component
This commit is contained in:
commit
c56e783534
@ -8,9 +8,9 @@ Tech(Library or Framework) | Version |
|
||||
--- | --- |
|
||||
React (Render Library) | 18.2.0
|
||||
Redux (Global State Management) | 4.2.1
|
||||
React Router DOM (Routing) | 6.15.0
|
||||
Jest (Testing) | 29.6.4
|
||||
Cypress (E2E Testing) | 13.1.0
|
||||
React Router DOM (Routing) | 6.16.0
|
||||
Jest (Testing) | 29.7.0
|
||||
Cypress (E2E Testing) | 13.3.0
|
||||
Typescript | 5.2.2
|
||||
|
||||
## Setup
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@aleleba/create-react-ssr",
|
||||
"version": "3.9.11",
|
||||
"version": "3.9.12",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@aleleba/create-react-ssr",
|
||||
"version": "3.9.11",
|
||||
"version": "3.9.12",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/register": "^7.22.15",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@aleleba/create-react-ssr",
|
||||
"version": "3.9.11",
|
||||
"version": "3.9.12",
|
||||
"description": "Starter Kit of server side render of react",
|
||||
"bin": "./bin/cli.js",
|
||||
"main": "src/server/index",
|
||||
|
@ -1,11 +1,13 @@
|
||||
import React from 'react';
|
||||
import './InitialComponent.scss';
|
||||
import { Link } from "react-router-dom";
|
||||
import { connect } from 'react-redux';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const InitialComponent = () => (
|
||||
const InitialComponent = ({ hello }: { hello: string }) => (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src="assets/img/logo.svg" className="App-logo" alt="logo" />
|
||||
<p>This is the text from the store of redux: <strong>{hello}</strong></p>
|
||||
<p>
|
||||
Edit <code>src/frontend/InitialComponent.jsx</code> and save to reload.
|
||||
</p>
|
||||
@ -22,4 +24,10 @@ const InitialComponent = () => (
|
||||
</div>
|
||||
);
|
||||
|
||||
export default InitialComponent;
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
hello: state.testReducer.hello
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(InitialComponent);
|
||||
|
@ -1,2 +1,3 @@
|
||||
const initialState = {};
|
||||
import { IInitialState } from './';
|
||||
const initialState: IInitialState = {};
|
||||
export default initialState;
|
||||
|
Loading…
Reference in New Issue
Block a user