The Road to React The React js in JavaScript Book 2024 Edition Robin Wieruch instant download
The Road to React The React js in JavaScript Book 2024 Edition Robin Wieruch instant download
https://ebookname.com/product/the-road-to-react-the-react-js-in-
javascript-book-2024-edition-robin-wieruch/
https://ebookname.com/product/learning-javascript-design-
patterns-a-javascript-and-react-developer-s-guide-2nd-edition-
adnan-osmani/
https://ebookname.com/product/learning-react-functional-web-
development-with-react-and-redux-1st-edition-alex-banks/
https://ebookname.com/product/learning-react-native-building-
native-mobile-apps-with-javascript-1-early-release-edition-
bonnie-eisenman/
https://ebookname.com/product/automating-with-
simatic-s7-1500-configuring-programming-and-testing-with-
step-7-professional-1st-edition-hans-berger/
Handbook of Laboratory Animal Bacteriology Second
Edition Axel Kornerup Hansen
https://ebookname.com/product/handbook-of-laboratory-animal-
bacteriology-second-edition-axel-kornerup-hansen-2/
https://ebookname.com/product/a-history-of-autism-conversations-
with-the-pioneers-1st-edition-adam-feinstein/
https://ebookname.com/product/programming-embedded-systems-with-
c-and-gnu-development-tools-2nd-edition-michael-barr/
https://ebookname.com/product/groundwater-in-the-environment-an-
introduction-1st-edition-paul-l-younger/
https://ebookname.com/product/natural-product-biosynthesis-by-
microorganisms-and-plants-part-c-1st-edition-david-a-hopwood-eds/
Hepatocellular Carcinoma A Practical Approach 1st
Edition Bandar Al Knawy
https://ebookname.com/product/hepatocellular-carcinoma-a-
practical-approach-1st-edition-bandar-al-knawy/
The Road to React
The React.js in JavaScript Book (2024 Edition)
Robin Wieruch
This book is for sale at http://leanpub.com/the-road-to-learn-react
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and
many iterations to get reader feedback, pivot until you have the right book and build traction once
you do.
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Who is this book for? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
How to read the book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Fundamentals of React . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Hello React . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Setting up a React Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Project Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
npm Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Meet the React Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
React JSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Lists in React . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Meet another React Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
React Component Instantiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
React DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
React Component Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Handler Function in JSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
React Props . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
React State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Callback Handlers in JSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Lifting State in React . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
React Controlled Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Props Handling (Advanced) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
React Side-Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
React Custom Hooks (Advanced) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
React Fragments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Reusable React Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
React Component Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Imperative React . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Inline Handler in JSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
React Asynchronous Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
CONTENTS
Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Foreword
I’ve been a React developer since its inception. When I first encountered it, there was an air of
mystery surrounding it as it distinguished itself from its competitors by emphasizing the exclusive
use of components. Over a decade later, I find myself unable to envision working with any other
framework in the near future. React continues to reinvent itself while pushing other frameworks
around it to evolve too. As a freelance web developer collaborating closely with companies, React
is my indispensable daily companion, enhancing my productivity in every project.
“The Road to React” made its debut in 2016, and since then, I’ve almost rewritten it annually. This
book teaches the core principles of React, guiding you through building a practical application in
pure React without complex tooling. The book covers everything from setting up the project to
deploying it on a server. Each chapter includes additional recommended reading and exercises. By
the end, you’ll have the skills to develop your own React applications.
In “The Road to React,” I establish a solid foundation before delving into the broader React ecosystem.
The book clarifies general concepts, patterns, and best practices for real-world React applications.
Ultimately, you’ll learn to construct a React application from scratch, incorporating features such
as pagination, client-side and server-side searching, and advanced UI interactions like sorting. My
aspiration is that this book conveys my passion for React and JavaScript, helping you embark on
your journey with confidence.
Foreword 2
FAQ
How to get updates?
Stay informed about the latest updates through two channels. You can subscribe to email updates²
or follow me on Twitter³. Regardless of the channel you choose, rest assured that I prioritize sharing
only high-quality content. Upon receiving a notification about an update for the book, simply visit
my website to download the latest version of the book.
Is the learning material up-to-date?
Unlike traditional programming books that quickly become outdated, this self-published book allows
for prompt updates whenever new versions of relevant tools or technologies are released. Rest
assured, you’ll always have access to the latest information.
Can I get a digital copy of the book if I’ve purchased it on Amazon?
If you’ve purchased the book on Amazon, you might have noticed it’s also available on my website.
Since I use Amazon as one way to generate revenue for my frequently free content, I genuinely
appreciate your support and I encourage you to sign up for my courses⁴. Once you’ve created an
account, send me an email detailing your Amazon purchase. This will enable me to unlock the
content for you. By having an account on my platform, you’ll always enjoy access to the most
up-to-date version of the book. Thank you for your support!
Why is the print version so large?
If you’ve acquired the print version of the book, consider making notes directly in its pages. The
deliberate choice to keep the printed book extra-large was made to provide ample space for extensive
code snippets and to afford you sufficient room for your annotations and personal notes. This size
decision was crafted with the intention of enhancing your overall reading and learning experience.
Why does the book not have many pages?
The print version’s larger dimensions contribute to fewer pages. While most sections are concise,
detailed material is available online for in-depth insights. This allows a smooth reading experience,
with essential React concepts covered in the book for a quick start. Engaging in optional exercises
is encouraged for a comprehensive understanding.
Why is the book written like a long read tutorial?
The unconventional manner in which this book is written and structured might come as a surprise to
those more accustomed to the conventional format of programming texts. When I first started coding,
there was a scarcity of practical, hands-on resources available. As a learner, I found great value
in materials that provided step-by-step instructions, guiding me through not only the ‘what’ and
‘how’ but also the ‘why’ behind each concept. With the goal of replicating this immersive learning
²https://rwieruch.substack.com/
³https://twitter.com/rwieruch
⁴https://courses.robinwieruch.de/
Foreword 4
experience, I’ve taken on the task of self-publishing, hoping to extend this valuable knowledge-
sharing opportunity to fellow developers within our community.
What do I do if I encounter a bug?
Should you come across any bugs in the code, locate the current GitHub project URL at the end of
each section. Feel free to open a GitHub issue there, and your assistance will be highly valued!
Foreword 5
Since every section introduces you to a new topic, it happens fast that you forget the learnings from
the previous section. In addition to coding along with every section, I recommend you to take breaks
between the sections which allow the learnings to sink in. Read the section, code along the way, do
the exercise afterwards, code even a bit more if you like, and then rest. Think about your learnings
while taking a walk outside or speak with someone about what you have learned even though this
other person is not into coding. After all, taking breaks is always essential if you want to learn
something new.
Fundamentals of React
In the initial phase of this learning journey, we’ll delve into the essential foundations of React,
guiding you through the creation of your first React project. As we progress, we’ll expand our
exploration of React’s capabilities, implementing practical features such as client and server-side
searching, remote data fetching, and advanced state management. This hands-on approach mirrors
the development of a real-world web application. By the end, you’ll have a fully functional React
application seamlessly interacting with real-world data.
Fundamentals of React 9
Hello React
Single-page applications (SPA⁵) have become increasingly popular with first-generation SPA frame-
works like Angular (by Google), Ember, Knockout, and Backbone. Using these frameworks made
it easier to build web applications that advanced beyond vanilla JavaScript and jQuery. React,
introduced by Facebook in 2013, is another solution for SPAs, offering yet another powerful
framework for building modern web applications in JavaScript.
Let’s take a trip back in time before the advent of SPAs: In the past, websites and web applications
were server-rendered. When a user accessed a URL in a browser, a request was made to a web
server, fetching one HTML file along with its associated HTML, CSS, and JavaScript files. After some
network delay, the user would see the rendered HTML in the browser and could begin interacting
with it. Each subsequent page transition would trigger this sequence of events again. In this earlier
version, the server handled most essential tasks, while the client’s role was minimal, primarily
focused on rendering pages. Basic HTML and CSS structured and styled the application, with a touch
of JavaScript, often in the form of the popular library jQuery, to enable interactions (e.g. toggling a
dropdown) or advanced styling (e.g. positioning a tooltip).
In contrast, SPA frameworks shifted the focus from the server to the client. In the world of SPAs, the
server primarily delivers JavaScript over the network, accompanied by a minimal HTML file. The
HTML file then executes the linked JavaScript files on the client-side (browser) to render the entire
application using HTML (and CSS), while still relying on JavaScript for interactions. In its most
extreme manifestation, a user visiting a URL requests a small HTML file and a larger JavaScript file.
Following a network and rendering delay, the user sees the HTML rendered by JavaScript in the
browser. Subsequent page transitions do not necessitate additional file requests from the web server
but instead utilize the initially requested JavaScript to render new pages.
React, along with other SPA solutions, played a pivotal role in making this transformation possible.
Essentially, a SPA is a single, organized bundle of JavaScript, neatly structured into folders and files,
creating an entire application. The SPA framework, such as React, provides the necessary tools to
architect this JavaScript-focused application. When a user visits the URL for your web application,
this JavaScript-centric application is delivered once over the network to their browser. Subsequently,
React or any other SPA framework takes charge of rendering everything in the browser as HTML
and managing user interactions with JavaScript.
With the ascent of React, the concept of components gained popularity. Each component defines its
visual and functional aspects using HTML, CSS, and JavaScript. Once a component is established, it
can be integrated into a hierarchy of components to construct a complete application. While React
primarily focuses on components as a library, its adaptable ecosystem positions it as a flexible
framework. Featuring a streamlined API, a flourishing yet stable ecosystem, and a supportive
community, React is ready to welcome you with open arms! :-)
⁵https://bit.ly/3BZOL1o
Fundamentals of React 10
Exercises
• Read more about Websites and Web Applications⁶.
• Watch React.js: The Documentary⁷.
• Read more about JavaScript fundamentals needed for React⁸.
• Optionally, if you need a motivational boost:
– Read more about how to learn a framework⁹.
– Read more about how to learn React¹⁰.
• Optional: Leave feedback for this section¹¹.
⁶https://www.robinwieruch.de/web-applications/
⁷https://bit.ly/3xrvxkI
⁸https://www.robinwieruch.de/javascript-fundamentals-react-requirements/
⁹https://www.robinwieruch.de/how-to-learn-framework/
¹⁰https://www.robinwieruch.de/learn-react-js/
¹¹https://forms.gle/NTqhvyDaP1RjtanC6
Fundamentals of React 11
Requirements
To navigate through this book, it’s essential to have a foundational understanding of web develop-
ment, encompassing HTML, CSS, and JavaScript. Familiarity with APIs¹² is beneficial, as they will
be discussed later. Additionally, you’ll require the following coding tools to follow along with the
book, complementing these skills.
Command Line
node --version
*vXX.YY.ZZ
npm --version
*vXX.YY.ZZ
If you have already installed Node and npm, make sure that your installation is the most recent
version. If you’re new to npm or need a refresher, this npm crash course¹⁷ I created will get you up
to speed.
Exercises:
• Optional: Read more about yarn¹⁸ and pnpm¹⁹. Both can be used as a replacement for npm.
However, I do not recommend using them as a beginner. This exercise should only make sure
that you know about the alternatives.
¹⁷https://www.robinwieruch.de/npm-crash-course/
¹⁸https://yarnpkg.com/
¹⁹https://pnpm.io/
Fundamentals of React 13
After navigating into a folder where you want to create your React project, type the following
command. We’ll refer to this project as hacker-stories, but you may choose any project name you
like:
Command Line
Optionally you can also go with a React + TypeScript project if you feel confident (check Vite’s
installation website to follow their instructions for a React + TypeScript project). The book comes
with a TypeScript section later, however, it will not do any hand-holding throughout the sections for
²⁰https://bit.ly/3BsG1TH
²¹https://bit.ly/3RPAZWz
Fundamentals of React 14
transforming JavaScript into TypeScript. Only at the end of each section you will find an alternative
TypeScript implementation.
Next, follow the instructions given on the command line for navigating into the folder, installing all
the third-party dependencies of the project, and running it locally on your machine:
Command Line
cd hacker-stories
npm install
npm run dev
The command line should output a URL where you can find your project running in the browser.
Open up the browser with the given URL and verify that you can see the React project running there.
We will continue developing this project in the next sections, however, for the rest of this section,
we will go through explaining the project structure and the scripts (e.g. npm run dev).
Fundamentals of React 15
Project Structure
First, let’s open the application in an editor/IDE. For VSCode, you can simply type code . on the
command line. The following folder structure, or a variation of it depending on the Vite version,
should be presented:
Project Structure
hacker-stories/
--node_modules/
--public/
----vite.svg
--src/
----assets/
------react.svg
----App.css
----App.jsx
----index.css
----main.jsx
--.eslintrc.cjs
--.gitignore
--index.html
--package-lock.json
--package.json
--README.md
--vite.config.js
• package.json: This file shows you a list of all third-party dependencies (read: node packages
which are located in the node_modules/ folder) and other essential project configurations
related to Node/npm.
• package-lock.json: This file indicates npm how to break down (read: resolve) all node package
versions and their internal third-party dependencies. We’ll not touch this file.
• node_modules/: This folder contains all node packages that have been installed. Since we
used Vite to create our React application, there are various node modules (e.g. React) already
installed for us. We’ll not touch this folder.
• .gitignore: This file indicates all folders and files that shouldn’t be added to your git repository
when using git, as such files and folders should be located only on your local machine. The
node_modules/ folder is one example. It is enough to share the package.json and package-
lock.json files with other developers in the team, so they can install dependencies on their end
with npm install without having to share the entire node_modules/ folder with everybody.
Fundamentals of React 16
• vite.config.js: A file to configure Vite. If you open it, you should see Vite’s React plugin
showing up there. If you would be running Vite with another web framework, the other
framework’s Vite plugin would show up. In the end, there are many more things that can
optionally be set up here.
• public/: This folder holds static assets for the project like a favicon²² which is used for the
browser tab’s thumbnail when starting the development server or building the project for
production.
• index.html: The HTML that is displayed in the browser when starting the project. If you open
it, you shouldn’t see much content though. However, you should see a script tag which links
to your source folder where all the React code is located to output HTML/CSS in the browser.
In the beginning, everything you need is located in the src/ folder. The main focus lies on the
src/App.jsx file which is used to implement React components. It will be used to implement your
application, but later you might want to split up your React components into multiple files, where
each file maintains one or more components on its own. We will arrive at this point eventually.
Additionally, you will find a src/main.jsx as an entry point to the React world. You will get to know
this file in later sections. There is also a src/index.css and a src/App.css file to style your overall
application and components, which comes with the default style when you open them. You will
modify them later as well.
²²https://bit.ly/3QvRupG
Fundamentals of React 17
npm Scripts
After you have learned about the folder and file structure of your React project, let’s go through
the available commands. All your project-specific commands can be found in your package.json file
under the scripts property. They may look similar to these depending on your Vite version:
package.json
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
These scripts are executed with the npm run <script> command in an IDE-integrated terminal or
your standalone command line tool. The commands are as follows:
Command Line
Another command from the previous npm scripts called preview can be used to run the production-
ready build on your local machine for testing purposes. In order to make it work, you have to execute
npm run build before running npm run preview. Essentially npm run dev and npm run preview (after
npm run build) should give the identical output in the browser. However, the former is not optimized
for production and should exclusively be used for the local development of the application.
Exercises:
• Read more about Vite²³.
• Exercise npm scripts:
– Start your React application with npm run dev on the command line and check it out in
the browser.
* Exit the command on the command line by pressing Control + C.
²³https://bit.ly/3BsG1TH
Fundamentals of React 18
– Run the npm run build script and verify that a dist/ folder was added to your project.
Note that the build folder can be used later on to deploy your application. Afterward, run
npm run preview to see the production-ready application in the browser.
• Every time we change something in our source code throughout the coming sections, make
sure to check the output in your browser for getting visual feedback. Use npm run dev to keep
your application running.
• Optional: If you use git and GitHub, add and commit your changes after every section of the
book.
• Optional: Leave feedback for this section²⁴.
²⁴https://forms.gle/bvH2jcppsSA6p9i16
Fundamentals of React 19
function App() {
const [count, setCount] = useState(0);
return (
<>
<div>
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank" rel="noreferrer">
<img
src={reactLogo}
className="logo react"
alt="React logo"
/>
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.jsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
Fundamentals of React 20
</>
);
}
This file will be our focus throughout this book, unless otherwise specified. Even though this file
will grow in size, because we are not splitting it up from the beginning into multiple files, it will
be simpler to understand as a beginner, because everything is at one place. Once you get more
comfortable with React, I will show you how to split your React project with your components into
multiple files.
Let’s start by reducing this React component to a more lightweight version for getting you started
without too much distracting boilerplate code²⁵:
src/App.jsx
function App() {
return (
<div>
<h1>Hello React</h1>
</div>
);
}
Optionally I recommend making the src/index.css and src/App.css files blank for starting from a
clean slate style-wise. Next, start your application with npm run dev on the command line and check
what’s displayed in the browser. You should see the headline “Hello React” showing up. Before we
dive deeper into each topic, here comes a quick overview of what’s in your code and what we will
cover more in-depth in the following sections:
• First, this React component, specifically called App component, is just a JavaScript function.
In contrast to traditional JavaScript functions, it’s defined in PascalCase²⁶. A component has
to start with a capital letter, otherwise it isn’t treated as a component in React. The kind of
the App component is commonly called a function component. Function components are the
modern way of using components in React, however, be aware that there are other variations
of React components (see component types in a later section) too.
• Second, the App component doesn’t have any parameters in its function signature yet. In
the upcoming sections, you will learn how to pass information (see props in a later section)
from one component to another component. These props will be accessible via the function’s
signature as parameters then.
²⁵https://bit.ly/3lZzckS
²⁶https://www.robinwieruch.de/javascript-naming-conventions/
Another Random Document on
Scribd Without Any Related Topics
"Major Barbara" is of still greater social importance, inasmuch as it
points to the fact that while charity and religion are supposed to
minister to the poor, both institutions derive their main revenue from
the poor by the perpetuation of the evils both pretend to fight.
It is inevitable that the Salvation Army, like all other religious and
charitable institutions, should by its very character foster cowardice
and hypocrisy as a premium securing entry into heaven.
However, Barbara's indignation does not last very long, any more
than that of her aristocratic mother, Lady Britomart, who has no use
for her plebeian husband except when she needs his money.
Similarly Stephen, her son, has become converted, like Barbara, not
to the Glory Hallelujah of the Salvation Army but to the power of
money and cannon. Likewise the rest of the family, including the
Greek Scholar Cusins, Barbara's suitor.
During the visit to their father's factory the Undershaft family makes
several discoveries. They learn that the best modern method of
accumulating a large fortune consists in organizing industries in such
a manner as to make the workers content with their slavery. It's a
model factory.
The family further learns that it is not high moral precepts, patriotic
love of country, or similar sentiments that are the backbone of the
life of the nation. It is Undershaft again who enlightens them of the
power of money and its rôle in dictating governmental policies,
making war or peace, and shaping the destinies of man.
Undershaft. The government of your country. I am the
government of your country: I, and Lazarus. Do you suppose
that you and a half a dozen amateurs like you, sitting in a row
in that foolish gabble shop, can govern Undershaft and Lazarus?
No, my friend: you will do what pays us. You will make war
when it suits us, and keep peace when it doesn't. You will find
out that trade requires certain measures when we have decided
on those measures. When I want anything to keep my dividends
up, you will discover that my want is a national need. When
either people want something to keep my dividends down, you
will call out the police and military. And in return you shall have
the support and applause of my newspapers, and the delight of
imagining that you are a great statesman. Government of your
country! Be off with you, my boy, and play with your caucuses
and leading articles and historic parties and great leaders and
burning questions and the rest of your toys. I am going back to
my counting house to pay the piper and call the tune.... To give
arms to all men who offer an honest price for them, without
respect of persons or principles: to Aristocrat and Republican, to
Nihilist and Tsar, to Capitalist and Socialist, to Protestant and
Catholic, to burglar and policeman, to black man, white man,
and yellow man, to all sorts and conditions, all nationalities, all
faiths, all follies, all causes and all crimes.... I will take an order
from a good man as cheerfully as from a bad one. If you good
people prefer preaching and shirking to buying my weapons and
fighting the rascals, don't blame me. I can make cannons: I
cannot make courage and conviction.
That is just it. The Undershafts cannot make conviction and courage;
yet both are indispensable if one is to see that, in the words of
Undershaft:
"I look upon the stage as the great beacon light of civilization, but
the drama should lead the social thought of the time and not direct
or dictate it.
"Moral codes in themselves are, after all, not lasting, but a true
picture of life is. A man may preach a strong lesson in a play which
may exist for a day, but if he succeeds in presenting real life itself in
such a manner as to carry with it a certain moral inspiration, the
force of the message need never be lost, for a new interpretation to
fit the spirit of the time can renew its vigor and power."
STRIFE
Its theme is a strike in the Trenartha Tin Plate Works, on the borders
of England and Wales. The play largely centers about the two
dominant figures: John Anthony, the President of the Company,
rigid, autocratic and uncompromising; he is unwilling to make the
slightest concession, although the men have been out for six months
and are in a condition of semi-starvation. On the other hand there is
David Roberts, an uncompromising revolutionist, whose devotion to
the workers and the cause of freedom is at red-white heat. Between
them are the strikers, worn and weary with the terrible struggle,
driven and tortured by the awful sight of poverty at home.
Edgar. I don't see how we can get over it that to go on like this
means starvation to the men's wives and families ... It won't kill
the shareholders to miss a dividend or two; I don't see that
that's reason enough for knuckling under.
Wilder. H'm! Shouldn't be a bit surprised if that brute Roberts
hadn't got us down here with the very same idea. I hate a man
with a grievance.
Edgar. We didn't pay him enough for his discovery. I always said
that at the time.
Wilder. The man's a rank agitator! Look here, I hate the Unions.
But now we've got Harness here let's get him to settle the
whole thing.
Enid does not know the life of Annie Roberts' class: that it is all a
gamble from the "time 'e's born to the time 'e dies."
Mrs. Roberts. Roberts says workin' folk have always lived from
hand to mouth. Sixpence to-day is worth more than a shillin' to-
morrow, that's what they say.... He says that when a working
man's baby is born, it's a toss-up from breath to breath whether
it ever draws another, and so on all 'is life; an' when he comes
to be old, it's the workhouse or the grave. He says that without
a man is very near, and pinches and stints 'imself and 'is
children to save, there can be neither surplus nor security.
That's why he wouldn't have no children, not though I wanted
them.
Harness. Cut your demands to the right pattern, and we'll see
you through; refuse, and don't expect me to waste my time
coming down here again. I'm not the sort that speaks at
random, as you ought to know by this time. If you're the sound
men I take you for—no matter who advises you against it—
you'll make up your minds to come in, and trust to us to get
your terms. Which is it to be? Hands together, and victory—or—
the starvation you've got now?
Thomas. It iss not London; it iss not the Union—it iss Nature. It
iss no disgrace whateffer to a potty to give in to Nature. For this
Nature iss a fery pig thing; it is pigger than what a man is.
There is more years to my hett than to the hett of anyone here.
It is a man's pisness to pe pure, honest, just, and merciful.
That's what Chapel tells you.... We're going the roat to
tamnation. An' so I say to all of you. If ye co against Chapel I
will not pe with you, nor will any other Got-fearing man.
At last Roberts makes his plea, Roberts who has given his all—brain,
heart and blood—aye, sacrificed even his wife to the cause. By sheer
force of eloquence and sincerity he stays his fickle comrades long
enough at least to listen to him, though they are too broken to rise
to his great dignity and courage.
David Roberts has all the mental and moral attributes of his
adversary, coupled with the spirit of revolt and the inspiration of
modern ideas. He, too, is consistent: he wants nothing for his class
short of complete victory.
JUSTICE
The play opens in the office of James How & Sons, solicitors. The
senior clerk, Robert Cokeson, discovers that a check he had issued
for nine pounds has been forged to ninety. By elimination, suspicion
falls upon William Falder, the junior office clerk. The latter is in love
with a married woman, the abused and ill-treated wife of a brutal
drunkard. Pressed by his employer, a severe yet not unkindly man,
Falder confesses the forgery, pleading the dire necessity of his
sweetheart, Ruth Honeywill, with whom he had planned to escape to
save her from the unbearable brutality of her husband.
Falder. Oh! sir, look over it! I'll pay the money back—I will, I
promise.
The second act, in the court room, shows Justice in the very process
of manufacture. The scene equals in dramatic power and
psychologic verity the great court scene in "Resurrection." Young
Falder, a nervous and rather weakly youth of twenty-three, stands
before the bar. Ruth, his faithful sweetheart, full of love and
devotion, burns with anxiety to save the young man, whose affection
for her has brought about his present predicament. Falder is
defended by Lawyer Frome, whose speech to the jury is a
masterpiece of social philosophy. He does not attempt to dispute the
mere fact that his client had altered the check; and though he
pleads temporary aberration in his defense, the argument is based
on a social consciousness as fundamental and all-embracing as the
roots of our social ills—"the background of life, that palpitating life
which always lies behind the commission of a crime." He shows
Falder to have faced the alternative of seeing the beloved woman
murdered by her brutal husband whom she cannot divorce, or of
taking the law into his own hands. He pleads with the jury not to
turn the weak young man into a criminal by condemning him to
prison.
Frome. Men like the prisoner are destroyed daily under our law
for want of that human insight which sees them as they are,
patients, and not criminals.... Justice is a machine that, when
someone has given it a starting push, rolls on of itself.... Is this
young man to be ground to pieces under this machine for an act
which, at the worst, was one of weakness? Is he to become a
member of the luckless crews that man those dark, ill-starred
ships called prisons?... I urge you, gentlemen, do not ruin this
young man. For as a result of those four minutes, ruin, utter
and irretrievable, stares him in the face.... The rolling of the
chariot wheels of Justice over this boy began when it was
decided to prosecute him.
But the chariot of Justice rolls mercilessly on, for—as the learned
Judge says—
The third scene of the third act is heart-gripping in its silent force.
The whole scene is a pantomime, taking place in Falder's prison cell.
Thanks to Ruth's pleading, the firm of James How & Son is willing to
take Falder back in their employ, on condition that he give up Ruth.
Falder resents this:
Falder. I couldn't give her up. I couldn't! Oh, sir! I'm all she's got
to look to. And I'm sure she's all I've got.
It is then that Falder learns the awful news that the woman he loves
had been driven by the chariot wheel of Justice to sell herself.
Ruth. I tried making skirts ... cheap things. It was the best I
could get, but I never made more than ten shillings a week,
buying my own cotton and working all day; I hardly ever got to
bed till past twelve. I kept at it for nine months.... It was
starvation for the children.... And then ... my employer
happened—he's happened ever since.
THE PIGEON
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com