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
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
View File

@ -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",

View File

@ -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",

View File

@ -1,25 +1,33 @@
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 = () => (
<div className="App">
<header className="App-header">
<img src="assets/img/logo.svg" className="App-logo" alt="logo" />
<p>
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>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
<Link className="App-link" to="/other-component">Other Component</Link>
</header>
</div>
</a>
<Link className="App-link" to="/other-component">Other Component</Link>
</header>
</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;