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:
Alejandro Lembke Barrientos 2023-10-09 14:24:46 -06:00 committed by GitHub
commit c56e783534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 25 deletions

View File

@ -8,9 +8,9 @@ Tech(Library or Framework) | Version |
--- | --- | --- | --- |
React (Render Library) | 18.2.0 React (Render Library) | 18.2.0
Redux (Global State Management) | 4.2.1 Redux (Global State Management) | 4.2.1
React Router DOM (Routing) | 6.15.0 React Router DOM (Routing) | 6.16.0
Jest (Testing) | 29.6.4 Jest (Testing) | 29.7.0
Cypress (E2E Testing) | 13.1.0 Cypress (E2E Testing) | 13.3.0
Typescript | 5.2.2 Typescript | 5.2.2
## Setup ## Setup

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@aleleba/create-react-ssr", "name": "@aleleba/create-react-ssr",
"version": "3.9.11", "version": "3.9.12",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@aleleba/create-react-ssr", "name": "@aleleba/create-react-ssr",
"version": "3.9.11", "version": "3.9.12",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/register": "^7.22.15", "@babel/register": "^7.22.15",

View File

@ -1,6 +1,6 @@
{ {
"name": "@aleleba/create-react-ssr", "name": "@aleleba/create-react-ssr",
"version": "3.9.11", "version": "3.9.12",
"description": "Starter Kit of server side render of react", "description": "Starter Kit of server side render of react",
"bin": "./bin/cli.js", "bin": "./bin/cli.js",
"main": "src/server/index", "main": "src/server/index",

View File

@ -1,25 +1,33 @@
import React from 'react'; import React from 'react';
import './InitialComponent.scss'; 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"> <div className="App">
<header className="App-header"> <header className="App-header">
<img src="assets/img/logo.svg" className="App-logo" alt="logo" /> <img src="assets/img/logo.svg" className="App-logo" alt="logo" />
<p> <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. Edit <code>src/frontend/InitialComponent.jsx</code> and save to reload.
</p> </p>
<a <a
className="App-link" className="App-link"
href="https://reactjs.org" href="https://reactjs.org"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
Learn React Learn React
</a> </a>
<Link className="App-link" to="/other-component">Other Component</Link> <Link className="App-link" to="/other-component">Other Component</Link>
</header> </header>
</div> </div>
); );
export default InitialComponent; const mapStateToProps = (state) => {
return {
hello: state.testReducer.hello
};
};
export default connect(mapStateToProps)(InitialComponent);

View File

@ -1,2 +1,3 @@
const initialState = {}; import { IInitialState } from './';
const initialState: IInitialState = {};
export default initialState; export default initialState;