PR-206472: fixing readme and adding text from redux store in initial component

This commit is contained in:
2023-10-09 20:20:09 +00:00
parent c3a586ff30
commit b1a51b96a8
5 changed files with 34 additions and 25 deletions

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;