Practice exercises and projects for the React Explained Book from Zac Gordon and OS Training.
zgordon / react-book Goto Github PK
View Code? Open in Web Editor NEWPractice exercises for "React Explained" book
Practice exercises for "React Explained" book
Practice exercises and projects for the React Explained Book from Zac Gordon and OS Training.
I've tried to bring up the 07-props/starter directory in my terminal and run npm install, but when I do so, I get a bunch of warnings that things are deprecated, and then I get an error that the maximum call stack size is exceeded. I'm new. Maybe I'm making a mistake, but I have the latest version of node and npm on my computer.
The beginning steps of "A React Project" have been rendered outdated in the 2020 edition of the book, as React Router has moved on to v6 on November 3, 2021. As such, certain parts mentioned will not work anymore, such as:
import {
BrowserRouter as Router,
Switch, // Switch has been changed to "Routes"
Route,
Redirect,
} from "react-router-dom";
On top of that, <Route />
will not work as the provided code in step 02 has it now, even after the name substitution from Switch
to Routes
. Page will render blank and display this warning in the console:
<Route />
now only supports an element
prop, which is incompatible with the current code structure. A name substitution such as render
to element
will not work either. The following error in console will occur:
The above issue can be remedied if the line
<Route exact path="/" render={() => <Posts posts={posts} />} />
is changed to
<Route exact path="/" element={<Posts posts={posts} />} />
A similar issue as the one just mentioned is present for the block of code responsible for rendering a single post:
<Route
path="/post/:postSlug"
render={(props) => {
const post = posts.find(
(post) => post.slug === props.match.params.postSlug
);
if (post) return <Post post={post} />;
else return <NotFound />;
}}
/>
The code for the UserForm is given as
const UserForm = props => (
{props.label}: //Incorrect
);This seems incorrect. At least the last double quotes should be removed for the state to update. The works for me: for example,
{props.label}: //REMOVED QUOTES
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.