100% found this document useful (1 vote)
171 views

PDF React Native in Action Developing iOS and Android apps with JavaScript 1st Edition Nader Dabit download

apps

Uploaded by

lucuseliko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
171 views

PDF React Native in Action Developing iOS and Android apps with JavaScript 1st Edition Nader Dabit download

apps

Uploaded by

lucuseliko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

React Native in Action Developing iOS and


Android apps with JavaScript 1st Edition
Nader Dabit

https://textbookfull.com/product/react-native-in-
action-developing-ios-and-android-apps-with-
javascript-1st-edition-nader-dabit-2/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

React Native in Action Developing iOS and Android apps


with JavaScript 1st Edition Nader Dabit

https://textbookfull.com/product/react-native-in-action-developing-
ios-and-android-apps-with-javascript-1st-edition-nader-dabit-2/

textbookfull.com

Fullstack React Native Create beautiful mobile apps with


JavaScript and React Native 5th Edition Devin Abbott

https://textbookfull.com/product/fullstack-react-native-create-
beautiful-mobile-apps-with-javascript-and-react-native-5th-edition-
devin-abbott/
textbookfull.com

Learning React Native Building Native Mobile Apps with


JavaScript 2nd Edition Bonnie Eisenman

https://textbookfull.com/product/learning-react-native-building-
native-mobile-apps-with-javascript-2nd-edition-bonnie-eisenman/

textbookfull.com

Pope Francis as a Global Actor: Where Politics and


Theology Meet 1st Edition Alynna J. Lyon

https://textbookfull.com/product/pope-francis-as-a-global-actor-where-
politics-and-theology-meet-1st-edition-alynna-j-lyon/

textbookfull.com
Overview of Industrial Process Automation, Second Edition
K.L.S. Sharma

https://textbookfull.com/product/overview-of-industrial-process-
automation-second-edition-k-l-s-sharma/

textbookfull.com

Prairie Imperialists The Indian Country Origins of


American Empire Katharine Bjork

https://textbookfull.com/product/prairie-imperialists-the-indian-
country-origins-of-american-empire-katharine-bjork/

textbookfull.com

The Tea Party and the remaking of Republican conservatism


Theda Skocpol

https://textbookfull.com/product/the-tea-party-and-the-remaking-of-
republican-conservatism-theda-skocpol/

textbookfull.com

The Specter of Hypocrisy: Testing the Limits of Moral


Discourse Raphael Sassower

https://textbookfull.com/product/the-specter-of-hypocrisy-testing-the-
limits-of-moral-discourse-raphael-sassower/

textbookfull.com

Gerontorheumatology 1st Edition Jozef Rovenský (Eds.)

https://textbookfull.com/product/gerontorheumatology-1st-edition-
jozef-rovensky-eds/

textbookfull.com
Rx.NET in Action with Examples in C# 1st Edition Tamir
Dresher

https://textbookfull.com/product/rx-net-in-action-with-examples-
in-c-1st-edition-tamir-dresher/

textbookfull.com
MANNING Developing iOS and Android apps with JavaScript

Nader Dabit
React Native in Action
React Native in Action
Developing iOS and Android apps with JavaScript

NADER DABIT

MANNING
Shelter Island
For online information and ordering of this and other Manning books, please visit www.manning.com.
The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: [email protected]

©2019 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form
or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the
publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in the book, and Manning Publications was aware of a
trademark claim, the designations have been printed in initial caps or all caps.

∞ Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books
we publish printed on acid-­free paper, and we exert our best efforts to that end. Recognizing also our
responsibility to conserve the resources of our planet, Manning books are printed on paper that is at
least 15 percent recycled and processed without the use of elemental chlorine.

Manning Publications Co. Development editor: Marina Michaels


20 Baldwin Road Project editor: Tiffany Taylor
PO Box 761 Copy editor: Tiffany Taylor
Shelter Island, NY 11964 Proofreader: Melody Dolab
Typesetter: Happenstance Type-O-Rama
Cover designer: Marija Tudor

ISBN: 9781617294051
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – SP – 24 23 22 21 20 19
brief contents
Part 1 Getting started with React Native.......................... 1
1 ■ Getting started with React Native 3
2 ■ Understanding React 27
3 ■ Building your first React Native app 45

Part 2 Developing applications in React Native...............73


4 ■ Introduction to styling 75
5 ■ Styling in depth 115
6 ■ Navigation 145
7 ■ Animations 162
8 ■ Using the Redux data architecture library 179

Part 3 API reference............................................................197


9 ■ Implementing cross‑platform APIs 199
10 ■ Implementing iOS-specific components and APIs 222
11 ■ Implementing Android-specific components and APIs 242

Part 4 Bringing it all together.........................................261


12 ■ Building a Star Wars app using cross-platform components 263

iii
contents
preface xi
acknowledgments xiii
about this book xv
about the author xviii
about the cover illustration xix

Part 1 Getting started with React Native...........1

1 Getting started with React Native


1.1 Introducing React and React Native
A basic React class 5 ■
3

React lifecycle 6
4

1.2 What you’ll learn 7


1.3 What you should know 7
1.4 Understanding how React Native works 8
JSX 8 ■
Threading 8 React 8 Unidirectional data
■ ■

flow 8 ■
Diffing 8 Thinking in components 9

1.5 Acknowledging React Native’s strengths 10


Developer availability 11 Developer productivity 11

Performance 12 One-way data flow 12 Developer


■ ■

experience 13 Transpilation 13 Productivity and


■ ■

efficiency 13 Community 14 Open source 14 Immediate


■ ■ ■

updates 14 Other solutions for building cross-platform mobile


applications 14

v
vi contents

1.6 React Native’s drawbacks 15


1.7 Creating and using basic components 15
An overview of components 16 Native components 16

Component composition 17 Exportable components 19


Combining components 21

1.8 Creating a starter project 22


Create React Native App CLI 22 ■
React Native CLI 23

2 Understanding React
2.1
27
Managing component data using state
Correctly manipulating component state 28
28

2.2 Managing component data using props 32


2.3 React component specifications 39
Using the render method to create a UI 39 ■
Using property
initializers and constructors 40

2.4 React lifecycle methods 41


The static getDerivedStateFromProps method 42
The componentDidMount lifecycle method 42
The shouldComponentUpdate lifecycle method 43
The componentDidUpdate lifecycle method 43
The componentWillUnmount lifecycle method 44

3 Building your first React Native app


3.1 Laying out the todo app 46
45

3.2 Coding the todo app 47


3.3 Opening the developer menu 52
Opening the developer menu in the iOS simulator 52 Opening

the developer menu in the Android emulator 53 ■


Using the
developer menu 53

3.4 Continuing building the todo app 55

Part 2 Developing applications in


React Native............................................. 73

4 Introduction to styling
4.1
75
Applying and organizing styles in React Native
Applying styles in applications 76 ■
Organizing
76

styles 78 Styles are code 80



Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
contents vii

4.2 Styling view components 83


Setting the background color 84 Setting border

properties 86 Specifying margins and padding 92 Using


■ ■

position to place components 97 Profile Card positioning 99


4.3 Styling Text components 100


Text components vs. View components 100 Font ■

styles 104 Using decorative text styles 107


5 Styling in depth
5.1
115
Platform-specific sizes and styles 116
Pixels, points, and DPs 116 Creating drop shadows with

ShadowPropTypesIOS and Elevation 118 Putting it into


practice: drop shadows in the ProfileCard 121

5.2 Using transformations to move, rotate, scale, and skew


components 122
3D effects with perspective 123 Moving elements along the x- and

y-axes with translateX and translateY 123 Rotating elements


with rotateX, rotateY, and rotateZ (rotate) 124 Setting visibility■

when rotating an element more than 90° 127 Scaling objects ■

on the screen with scale, scaleX, and scaleY 128 Using the scale ■

transform to create a thumbnail of the ProfileCard 129 Skewing ■

elements along the x- and y-axes with skewX and skewY 132
Transformation key points 134

5.3 Using flexbox to lay out components 135


Altering a component’s dimensions with flex 135 Specifying the ■

direction of the flex with flexDirection 136 Defining how space


is used around a component with justifyContent 137 Aligning ■

children in a container with alignItems 139 Overriding the■

parent container’s alignment with alignSelf 140 Preventing ■

clipped items with flexWrap 142

6 Navigation
6.1
145
React Native navigation vs. web navigation 146
6.2 Building a navigation-based app 146
6.3 Persisting data 159
6.4 Using DrawerNavigator to create drawer-based
navigation 160

7 Animations
7.1
162
Introducing the Animated API 163
viii contents

7.2 Animating a form input to expand on focus 165


7.3 Creating a custom loading animation using
interpolation 167
7.4 Creating multiple parallel animations 170
7.5 Creating an animated sequence 172
7.6 Using Animated.stagger to stagger animation start
times 175
7.7 Other useful tips for using the Animated library 177
Resetting an animated value 177 Invoking a ■

callback 177 Offloading animations to the native


thread 177 Creating a custom animatable component using


createAnimatedComponent 178

8 Using the Redux data architecture library


8.1 What is Redux? 179
179

8.2 Using context to create and manage global state in a React


application 180
8.3 Implementing Redux with a React Native app 181
8.4 Creating Redux reducers to hold Redux state 183
8.5 Adding the provider and creating the store 184
8.6 Accessing data using the connect function 185
8.7 Adding actions 187
8.8 Deleting items from a Redux store in a reducer 192

Part 3 API reference............................................. 197

9 Implementing cross‑platform APIs


9.1 Using the Alert API to create cross-platform
notifications 200
199

Use cases for alerts 200 ■


Example of using alerts 201

9.2 Using the AppState API to detect the current application


state 202
Use cases for AppState 203 ■
Example of using AppState 203

9.3 Using the AsyncStorage API to persist data 204


Use cases for AsyncStorage 204 ■
Example of using
AsyncStorage 205
contents ix

9.4 Using the Clipboard API to copy text into the


user’s clipboard 207
Use cases for Clipboard 207 ■
Example of using Clipboard 207

9.5 Using the Dimensions API to get the user’s


screen information 208
Use cases for the Dimensions API 209 ■
Example of using the
Dimensions API 209

9.6 Using the Geolocation API to get the user’s current


location information 209
Use cases for the Geolocation API 210 ■
Example of using
Geolocation 210

9.7 Using the Keyboard API to control the location and


functionality of the native keyboard 212
Use cases for the Keyboard API 212 ■
Example of using the
Keyboard API 213

9.8 Using NetInfo to get the user’s current online/offline


status 214
Use cases for NetInfo 215 ■
Example of using NetInfo 216

9.9 Getting information about touch and gesture events with


PanResponder 216
Use cases for the PanResponder API 217 ■
Example of using
PanResponder 218

10 Implementing iOS-specific components and APIs 222


10.1 Targeting platform-specific code 223
iOS and Android file extensions 223 ■
Detecting the platform
using the Platform API 224

10.2 DatePickerIOS 226


Example of using DatePickerIOS 226

10.3 Using PickerIOS to work with lists of values 228


Example of using PickerIOS 230

10.4 Using ProgressViewIOS to show loading indicators 231


Use cases for ProgressViewIOS 232 ■
Example of using
ProgressViewIOS 232

10.5 Using SegmentedControlIOS to create horizontal tab bars 233


Use cases for SegmentedControlIOS 234 ■
Example of using
SegmentedControlIOS 234
x contents

10.6 Using TabBarIOS to render tabs at the bottom of


the UI 235
Use cases for TabBarIOS 236 ■
Example of using
TabBarIOS 237

10.7 Using ActionSheetIOS to show action or share sheets 238


Use cases for ActionSheetIOS 239 ■
Example of using
ActionSheetIOS 239

11 Implementing Android-specific components and APIs 242


11.1 Creating a menu using DrawerLayoutAndroid 243
11.2 Creating a toolbar with ToolbarAndroid 247
11.3 Implementing scrollable paging with
ViewPagerAndroid 248
11.4 Using the DatePickerAndroid API to show a native date
picker 251
11.5 Creating a time picker with TimePickerAndroid 253
11.6 Implementing Android toasts using ToastAndroid 256

Part 4 Bringing it all together......................... 261

12 Building a Star Wars app using cross-platform components 263


12.1 Creating the app and installing dependencies
Importing the People component and creating the Container
265

component 266 Creating the navigation component and


registering routes 267 Creating the main class for the initial

view 267

12.2 Creating the People component using FlatList, Modal,


and Picker 270
Creating the state and setting up a fetch call to
retrieve data 271 Adding the remaining class

methods 273 Implementing the render method



274

12.3 Creating the HomeWorld component 276


Creating the HomeWorld class and initializing
state 276 Fetching data from the API using the url

prop 278 Wrapping up the HomeWorld component



279

appendix 281

index 285
preface
I’ve always been fascinated with the idea of mobile application development. Building
mobile apps was one of the reasons I wanted to learn how to code. This fascination has
lead me down many paths, from Objective-C to jQuery mobile to Cordova and now to
React Native.
Because my career has centered around writing JavaScript, I’ve also always been
drawn to technologies that increase my efficiency by using my existing skillset, allowing
me to do more than just web development. Finding ways to be more efficient has been
core to my career when choosing paths to follow and rabbit holes to dive into.
When React Native first landed, I knew that it was going to be something signifi-
cant. There were already thousands of React and JavaScript developers in the world.
React Native gave these developers a way to extend their existing skillset into the realm
of mobile application development in a way that Cordova and other options didn’t,
and also appealed heavily to React developers who were at the time the most rapidly
growing segment of all frontend developers. The framework also delivered a substantial
increase in quality of applications that could be built versus other options available in
the same space.
After writing my first application and shipping it to the app store, I had learned quite
a bit and decided to start answering questions on Stack Overflow. I quickly realized that
I had valuable knowledge I could share, while helping the community as well my career,
so I began hanging out there more and more, answering questions.
I learned a lot while answering these questions, and eventually I made a conscious
decision to specialize 100% in the React Native framework. I heard from many suc-
cessful developers and consultants that specializing had helped them in their careers:
they were more productive, got more business, and could demand a higher rate. So, I

xi
xii preface

decided to try being a specialist for the first time in my career. This decision turned out
to be great for me; I quickly began getting leads for consulting and, later, training.
I’ve watched the React Native framework grow from its infancy to what it is today
and have seen many developers and companies rapidly increase their efficiency and
productivity by taking advantage of what the framework has to offer. I think we’re at an
exciting time for React Native: many Fortune 500 companies and enterprises are pick-
ing it up, finally solidifying it as a first-class choice in their developer toolkits and giving
more confidence to people who are considering betting their companies and applica-
tions on the framework. It will be exciting to watch the framework evolve and to see the
new apps that will be shipped using React Native!
acknowledgments
This is the first time I’ve written a book. It has been a good learning experience,
and also much more work than I anticipated. While I’ve been writing, my career has
changed a couple of times and my obligations along with it, affecting the amount of
time I could commit to the book. Nickie Buckner and Marina Michaels are the reason
this book is complete. If it wasn’t for them, it would have been in editing indefinitely; I
was unable to rewrite a couple of chapters in a reasonable amount of time, and Nickie
stepped up in a huge way to finish the book. Marina also did more than what was called
for in helping the book make it the last 20% of the way as my time became increasingly
constrained.
Thank you to my wife, Lilly, who worked overtime in addition to her already exceed-
ingly high normal duties as I worked late nights in the office and sometimes at home
to write this book. Thank you to my kids, Victor and Eli, who are awesome; I love them
very much. And thank you to my parents for putting me in a position to be able to learn
things and get second, third, and fourth chances at life.
My thanks go to many groups and individuals: to the React Native community and
the React Native team (Jordan Walke, Christopher Chedeau, Adam Wolff, and every-
one at Facebook over the years whom I didn’t mention); to Monte Thakkar, who took
over React Native Elements’ open source while I was writing (and to all React Native
Training open source contributors); to Eric Vicenti and Brent Vatne and all the people
who have worked on Navigation and many other projects I use day to day; to Charlie
Cheever, who has, with Expo, pushed the development of many React Native projects
and, by extension, of Expo, and who has helped many open source projects; to Parasha-
rum N, who has been committed to building things around React Native for years, now
works on React Native at Facebook, and has always been a great asset to the community

xiii
xiv acknowledgments

and ecosystem; to Peter Piekarczyk, Kevin Old, Lee Johnson, Gant Laborde, and Spen-
cer Carli, who have consistently helped with the “React Native Radio” podcast; to Russ
Davis and SchoolStatus, for the opportunity to learn React Native on the job, which is
how I got started with it in the first place; to Orta Therox and the people at Artsy, for
their commitment to the React Native community with their amazing blog and open
source; to Leland Richardson, Devin Abbott, and the team at Airbnb, who gave React
Native a fair shot and contributed extensively to the ecosystem even though the frame-
work didn’t work out for Airbnb in the long run; to the Wix team, who have contributed
many amazing projects to the React Native open source ecosystem; to Mike Grabowski
and Anna Lankauf, of Callstack, for being in charge of releasing React Native open
source, for many contributions to the React Native open source ecosystem, and for col-
laborating with me on things over the years; and to Jason Brown for pushing amazing
blog posts and teaching me about animations early on. I’m sure I left out many people,
and if that person is you, I apologize and thank you for your contribution, as well.
Finally, I want to thank the people at Manning who made this book possible: pub-
lisher Marjan Bace and everyone behind the scenes on the editorial and production
teams. My thanks also to the technical peer reviewers led by Aleksandar Dragosavljević:
Alessandro Campeis, Andriy Kharchuk, Francesco Strazzullo, Gonzalo Barba López,
Ian Lovell, Jason Rogers, Jose San Leandro, Joseph Tingsanchali, Markus Matzker,
Matej Strašek, Mattias Lundell, Nickie Buckner, Olaoluwa Oluro, Owen Morris, Roger
Sperberg, Stuart Rivero, Thomas Overby Hansen, Ubaldo Pescatore, and Zhuo Hong
Wei. On the technical side, my thanks to Michiel Trimpe, who served as the book’s tech-
nical editor; and Jason Rogers, who served as the book’s technical proofreader.
about this book
React Native in Action was written to get you up and running with the React Native
framework as quickly and seamlessly as possible. It uses a combination of real-world
examples, discussions around APIs and development techniques, and a focus on learn-
ing things that will translate into real-world scenarios.
The book begins with an overview of React Native in chapter 1, following by a look
at how React works in chapter 2. From chapter 3 through the end of the book, you
build applications containing functionality you’ll use to build applications in the real
world. The book dives deep into topics such as data architecture, navigation, and ani-
mations, giving you a well-rounded understanding of how to build mobile apps using
React Native.
The book is divided into 4 parts and 12 chapters:
¡ Part 1, “Getting Started with React Native”:
¡ Chapter 1 gets you up and running with React Native by going over what React
Native is, how it works, its relationship with React, and when you might want
to use React Native (and when you might not). This chapter includes an over-
view of React Native’s components, which are at the core of React Native. It
concludes with creating a small React Native project.
¡ Chapter 2 covers state and props: what they are, how they work, and why
they’re important in React Native application development. It also covers the
React Component specification and React lifecycle methods.
¡ In chapter 3, you build your first React Native app—a todo app—from the
ground up, and you’ll learn about using the developer menu in iOS and
Android to, among other things, debug your app.

xv
xvi about this book

¡ Part 2, “Developing Applications in React Native.” With the basics covered, you
can start adding features to your React Native app. The chapters in this part cover
styling, navigation, animations, and elegant ways to handle data using data archi-
tectures (with a focus on Redux):
¡ Chapters 4 and 5 teach you how to apply styles: either in line, with compo-
nents, or in stylesheets that components can reference. Because React Native
components are the main buildings blocks of your app’s UI, chapter 4 spends
some time teaching useful things you can do with the View component. Chap-
ter 5 builds on the skills taught in chapter 4; it covers aspects of styling that
are platform-specific, as well as some advanced techniques, including using
flexbox to make it easier to lay out applications.
¡ Chapter 6 shows how to use the two most-recommended and most-used
navigation libraries: React Navigation and React Native Navigation. We’ll
walk through creating the three main types of navigators—tabs, stack, and
drawer—and discuss how to control the navigation state.
¡ Chapter 7 covers the four things you need to do to create animations, the four
types of animatable components that ship with the Animated API, how to cre-
ate custom animatable components, and several other useful skills.
¡ In chapter 8, we explore handling data with data architectures. Because Redux
is the most widely adopted method of handling data in the React ecosystem,
you’ll use it to build an app. Through doing so, you’ll learn the skills needed
to handle data. You’ll see how to use the Context API and how to implement
Redux with a React Native app by using reducers to hold the Redux state and
delete items from the example app. You’ll also learn how to use providers to
pass global state to the rest of the app, how to use the connect function to
access the example app from a child component, and how to use actions to
add functionality.
¡ Part 3, “API Reference.” React Native offers a wealth of APIs. The chapters in
this part cover cross-platform APIs as well as APIs that are specific to the iOS and
Android platforms:
¡ Chapter 9 explores using React Native’s cross-platform APIs: APIs that can be
used on either iOS or Android to create alerts; detect whether the app is in the
foreground, in the background, or inactive; persist, retrieve, and remove data;
store and update text to the device clipboard; and perform a number of other
useful features.
¡ Chapters 10 and 11 look at React Native’s APIs that are specific to either the
iOS platform or the Android platform.
¡ Part 4, “Bringing It All Together.” This part pulls together everything covered
in the previous chapters—styling, navigation, animations, and some of the
cross-platform components—into a single app:
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
about this book xvii

¡ Chapter 12 starts by looking at the final design and walking through a basic
overview of what the app will do. Then, you’ll create a new React Native appli-
cation and install the React Navigation library, dive deep into styling both the
components as well as the navigation UI, work with data from external net-
work resources by using the fetch API, and ultimately build out an application
that allows users to view information about their favorite Star Wars characters.

Source code
This book contains many examples of source code, both in numbered listings and
inline with normal text. In both cases, source code is formatted in a fixed-width font
like this to separate it from ordinary text.
In many cases, the original source code has been reformatted; we’ve added line
breaks and reworked indentation to accommodate the available page space in the
book. In rare cases, even this was not enough, and listings include line-continuation
markers (➥).
Additionally, comments in the source code have often been removed from the list-
ings when the code is described in the text. Code annotations accompany many of the
listings, highlighting important concepts.
Source code for the book’s examples is available from the publisher’s website at www.
manning.com/books/react-native-in-action and on GitHub at https://github.com/
dabit3/react-native-in-action.

Book forum
Purchase of React Native in Action includes free access to a private web forum run by
Manning Publications where you can make comments about the book, ask technical
questions, and receive help from the author and from other users. To access the forum,
go to https://livebook.manning.com/#!/book/react-native-in-action/discussion. You
can also learn more about Manning’s forums and the rules of conduct at https://live-
book.manning.com/#!/discussion.
Manning’s commitment to our readers is to provide a venue where a meaningful dia-
logue between individual readers and between readers and the author can take place. It
is not a commitment to any specific amount of participation on the part of the author,
whose contribution to the forum remains voluntary (and unpaid). We suggest you try
asking the author some challenging questions lest his interest stray! The forum and the
archives of previous discussions will be accessible from the publisher’s website as long as
the book is in print.
about the author
Nader Dabit is a developer advocate at AWS Mobile, where he works on tools and ser-
vices to allow developers to build full-stack web and mobile applications using their
existing skillset. He is also the founder of React Native Training and the host of the
“React Native Radio” podcast.

xviii
about the cover illustration
The figure on the cover of React Native in Action is captioned “Insulaire D’Amboine”
or “Islander of Amboine.” The illustration is taken from a nineteenth-century edition
of Sylvain Maréchal’s four-volume compendium of regional dress customs published
in France. Each illustration is finely drawn and colored by hand. The rich variety of
Maréchal’s collection reminds us vividly of how culturally apart the world’s towns and
regions were just 200 years ago. Isolated from each other, people spoke different dia-
lects and languages. Whether on city streets, in small towns, or in the countryside, it
was easy to identify where they lived and what their trade or station in life was just by
their dress.
Dress codes have changed since then and the diversity by region and class, so rich at
the time, has faded away. It is now hard to tell apart the inhabitants of different conti-
nents, let alone different towns or regions. Perhaps we have traded cultural diversity for a
more varied personal life—certainly for a more varied and fast-paced technological life.
At a time when it is hard to tell one computer book from another, Manning cel-
ebrates the inventiveness and initiative of the computer business with book covers
based on the rich diversity of regional life of two centuries ago, brought back to life by
Maréchal’s pictures.

xix
Part 1

Getting started with


React Native

C hapter 1 will get you up and running by going over what React Native is,
how it works, what its relationship with React is, and when you might want to use
React Native (and when you might not). This chapter provides an overview of
React Native’s components, which are at the core of React Native. It concludes
with creating a small React Native project.
Chapter 2 covers state and properties: what they are, how they work, and why
they’re important in React Native application development. It also covers the
React Component specification and React lifecycle methods.
In chapter 3, you’ll build your first React Native app—a Todo app—from the
ground up. You’ll also learn about using the developer menu in iOS and Android
for, among other things, debugging apps.
Random documents with unrelated
content Scribd suggests to you:
and help from it after than when actually gazing at it. But if it is to
continue to please us, beauty must bear to be thought about. If we
cannot dwell with satisfaction on the origin or production of the
beautiful object, its beauty ceases to please, we feel it to be
superficial.
This desire for such a harmony in our life and surroundings as will
not alone delight the eye, but will also satisfy and please the mind
and heart, springing as it does from a deeper appreciation of beauty,
will have far-reaching results in the direction of wedding art and
simplicity together. There are many who can no longer enjoy an
artistic life above stairs, undisturbed by the lack of what art could
add, in the life below stairs on which it rests; for they feel that no
beauty in the drawing room can make up for the want of beauty in
the lives of those in the kitchen; no refinement in the study
compensate for the utter lack of it in the workshop. In fact we are
coming to realize that although we may have the right and the
power to create for ourselves a costly palace to dwell in, and to
gather around us all the luxuries and refinements we can think of,
and may moreover have plenty of servants to wait on us and plenty
of labourers to help us to support our costly life; yet art will not
make such a life beautiful, simply because of that want of harmony
between the life and all that goes to support it. However right and
just such a life may be thought to be, it cannot be beautiful.
And so those to whom beauty really appeals are seeking a simpler
form of life, one which need not cost so much of the labour of others
to maintain, or so much of their own to procure. And the more they
come to love & enjoy beauty, the greater must this tendency to
simplicity of life become, not from any virtue or asceticism, but
simply as a matter of choice. Why should one having such tastes
encumber himself with an elaborate household, which but offends
his inner love of harmony, and takes his time and energy from the
enjoyment of so much greater pleasure? He knows that the art in a
picture belongs to all who can appreciate it, not solely to the
purchaser of it, who buys not the art but the right to shut it up; and
he realizes that the beauty of a landscape is a pleasure open to all
who can see it, and that it cannot be conveyed in the title deed.
Such an one does not barter away his time and his freedom to enjoy
these solid pleasures, for the sake of a fine house, fine society, or
any other fictitious refinements. He minds not how simple his
surroundings, if only he may be able to dwell in thought on
everything he handles or sees about him without any painful
suggestion of drudgery in the making of them, or squalor in the
maintaining of them, marring his pleasure in their simple elegance.
The most humble house will content him, so only he may have time
and quiet to appreciate the beauties of nature and art, and
opportunity for the sharing with others of like taste the enjoyment of
these things. For the love of beauty is not selfish, it grows by
sharing: we all love to make others see the beauty that we enjoy.
It is true that such a man may be fastidious, that he may hate all
ugly or sordid things, and may demand that everything he has shall
be the best of its kind. But this must not be confounded with a
desire for many things, or a dislike of simple ones. The musician too,
is hurt by harsh sounds and requires his music to be of the best, but
he does not ask that an orchestral concert shall be for ever going
on.
This general dependence of beauty on simplicity, at any rate in the
private dwelling house, is of special interest to those whose function
it is to give an artistic setting to the lives of clients by so designing
their homes that they shall be comfortable for those who are to
occupy them and comely for all who shall behold them. The architect
is astonished to find how very conventional generally are the reasons
which dictate the size and arrangement of the house. He is
impressed by the great difference that exists between what are
considered to be suitable houses for different classes of people: and
he begins to wonder whether there are not discoverable some
factors determining what is a suitable size for a man’s shell having
more intimate relation to his life than the depth of his pocket, or
some reason for its form and adornment less conventional than
those usually accepted.
For example, an architect receives a commission to design some
labourers’ cottages. The cost is the first stipulation: this must be low
enough for the cottages to yield a fair return on the outlay when let
at such rents as the labourers can afford to pay out of their present
wages. Probably the next stipulation is that each house must have a
parlour, kitchen, and three bedrooms. The usual result of such
instructions is a design for a row of cottages, all alike, each having a
small parlour in front with a front door into it, a kitchen behind—it is
well if this is not smaller still—with the stairs going up between the
two and a little larder under: the kitchen has a back door leading
into the yard, a sink under the only window, and a copper between
that and the fire. Here we have as the living-room for a family a
place twelve to fifteen feet square, containing three doors, a sink,
and a copper. True there is a sitting-room; but that is of little use.
The occupants will have neither money to find coal for a second fire,
nor energy to keep the fire going and the room tidy for use, nor will
there be any inclination for the family to divide for the little time
they are all at home. But a false convention of respectability
demands this sitting-room; and the stern limits of cost preclude the
possibility of having a scullery or washhouse in addition.
How an architect must wish he could attack this commission from
another standpoint. How he must long to design a house to fit the
habits of life of those who are to occupy it. Then he would work on
quite different lines. Knowing that the family will practically live in
the kitchen, he would think out the space needed to give room for
doing work, taking meals, and resting. He would consider what of
the work which must be done most tends to make the living-room
uncomfortable and dirty; and he would banish that to a scullery or
wash-house. In the living-room he would plan so that there might be
warm seats round the fire in winter, free from draughts, and seats
for summer near the window; a good dresser for work, well lighted
and supplied with cupboards, plate-rack, and perhaps a small
washing-up sink for the crockery. Then he would allow space for a
table for meals, and a few shelves for books; perhaps he might even
find a corner for a piano or desk, in case either should be wanted.
Instead of the sitting-room, he would either build a little den for
quiet reading or writing, if any member of the family desired to
study, or more probably so plan one of the bedrooms that a portion
of it could be made cosy for such a purpose, about the only one for
which a sitting-room would be at all likely to be wanted.
Remembering too that cleanliness has been placed only second
among virtues, and that probably most of the labourers would have
dirty and arduous work, he would contrive to give a bath; and if
nothing better could be done might put it in the scullery. In this way
he would have obtained a cottage as nearly as possible fitted to the
lives of the people. It would take no more daily labour and expense
to keep up than the conventional one, and would not cost such a
great deal more to build—in fact, omitting the bath, and keeping
within the total size, need cost no more.
Perhaps the next commission is for a country house. It is stipulated
that there shall be dining-room, drawing-room, and library, a good
entrance hall and six bedrooms, together with kitchen, scullery, two
servants’ bedrooms, butler’s pantry, china pantry, larder, laundry, a
lavatory and cloak-room on the ground floor, and a bathroom on
each bedroom floor. Such requirements have probably as little real
connection with the lives of the people who are to live in the house,
as the conventions which dictated the two roomed cottage. The size
of the house has more to do with the social position assumed by its
owner, than with the number of his household; and the library quite
as likely is due to the length of his purse, as to the number of his
books or his literary pursuits.
Somewhere between these two extremes must lie the sort of house
which the lover of art and beauty would desire for himself.
Somewhere, in each case, must the two opposing tendencies of
comfort and simplicity meet. Up to a certain point it will add to a
man’s real pleasure in life to enlarge upon the bare shelter of the
labourer’s cottage; but beyond that point any gain there may be will
be too dearly bought. This point is fixed for any individual, but must
of course vary widely with the temperament and circumstances of
each. It is sufficient for our purpose to realize that there is such a
point, and that the development of a man’s love of beauty and art
will in the long run give more and more force to the tendencies
which make for simplicity. Those whose main desire is for beauty in
their lives, are coming to see that to the rational cottage as sketched
above, with its ample living-room and the other absolute necessaries
of a decently comfortable life, they must add with great caution and
reluctance, and only as dictated by really pressing needs. Every
extra room is an added care, means further demands on time and
energy, and makes it harder to maintain the home without
introducing additional inharmonious elements in the way of service.
It is possible, though not easy, to introduce one helper into the
home life on equal terms, but very difficult indeed to do this with
two. The increase of the house must be zealously resisted, if it is to
be kept within the limits of one helper doing a fair share of work.
And not only must the size be watched: the furnishing and
decorating likewise need to be kept simple. It is a good rule in such
a house to add nothing until actually needed, and to think well
whether the pleasure and comfort it can give will repay the care and
dusting it will require.
Working on these lines there will be a good chance that our homes
will grow beautiful, that they will fit our lives and be really filled with
life. When we try how few things we can do with, we also begin to
try how beautiful those few may be made. When we value our time,
and the time of our helpers, by the pleasure which may be had from
a wise use of it, we shall take care that any adornment we have,
shall at least give pleasure equal to any other use we might have
made of the time required to obtain it. Therefore none but good
decoration will tempt us. We shall be content with our bare coloured
walls, until perhaps some artist friend comes along and adorns them
for us with some true ornament, which will be an abiding
satisfaction, not only in the direct suggestion which it conveys, but
also in the memories it revives of a pleasant visit and a guest happy
in a congenial task.
RAYMOND UNWIN.
OF FURNITURE. Part 1.
A lecture given before a gathering of art workers.

UR instructions for to-night are that we show you


examples of some of our work. But we have
found ourselves unable to comply with the letter
of the instructions, to confine the examples that
we show you to-night to furniture; for, of furniture
which can be considered apart from the building it
furnishes, we have scarcely any to show.
Complying as nearly as we can, we will as far as possible keep within
what may be considered furnishing.
Before proceeding to the illustrations of our work, I would like to
point out what we claim you shall find to be its leading
characteristics: and among these I will name first, absolute
simplicity, directness, and straightforwardness. I feel that we are to-
day so completely smothered in lifeless and meaningless fuss of
pattern, moulding, knick-knack, flourish and convention, and the
machine-made & mechanically produced substitute for ornament,
that it is well-nigh impossible for our artistic sensibilities to exist at
all unless liberated from them. I would mention secondly complete
unity and absolute harmony between all the parts, such as can only
be obtained when a house, its decorations and furniture, are all
designed by one man—or at least under the entire supervision of
one man. Now when I claim that if the result is to be artistically
satisfactory, nay also if it is to be satisfactory from the point of view
of comfort and practical utility, the house and everything in the
house must from the first be thought of and designed as a whole,
the objection most commonly made is that a house should reflect
somewhat the character, habits, and taste of those who live in it;
and that if the architect is to make his influence felt in every detail of
its furnishing and decoration, it will show his feeling, taste, and
character, not his client’s.
There seems at first glance to be some truth in this; but a very little
thought will show, that instead of the power of the members of a
household to impress their own individuality upon their home being
lessened by this extension of the architect’s influence, it would be
greatly increased.
The architect who is worth anything will always design a house
which will fit any particular client much better than would any house
he could possibly find not designed for him: and of furniture, fittings
and decoration, and all else belonging to a house, this is also true.
The client wanting a piece of furniture, can otherwise only select,
from those offered for sale in the shops, that which will most nearly
fill the place of something designed specially to meet his
requirements. His own taste and individuality can have no influence
upon it whatever; no say in the form it shall take; this has been
decided for him by a designer to whom he probably never gives a
thought. But if his architect designs something to fit him & his
house, the client can make his own taste felt from the beginning; he
can make known to his architect his own personality, habits, and
feeling; and have some chance of getting what will accord with
these and moreover be in proper relation with the whole. It is not a
question whether he shall have things to his own design or to that of
another: this would be a different matter altogether: the question is:
Shall he have things designed to fit in with him and his
requirements, or do the best he can with what chance may offer
him?
It has struck me as very wonderful how good a result has in rare
instances been attained by one of true artistic feeling through long
years of careful watchfulness making the most of such opportunities
as came in his way of picking up & gathering round him—often in a
house which has not a redeeming characteristic—furniture and
decoration which his own taste has told him are good and
reasonably congruous. But I have always felt: What would not this
man have made of it if he had been able to have some influence
upon the design for the house and the things in it! By choosing an
architect capable of sympathy with his own artistic feeling, he could
have done more at the very outset towards procuring a fitting
setting for himself and his life, than he has been able to do by all his
care and thought in selection.
That they who lack taste will also stamp their own individuality on
the house they live in, no matter how extended has been the
architect’s province, we know to our cost to be only too true.
All here know that the only right way to go to work to design
anything is to give it that form which will best enable it to fulfil its
functions, that form which is best adapted to the methods by which
it is to be produced, at the same time giving it the most beautiful
form consistent with & explaining these conditions of purpose and
construction: and I contend further that to gain artistic success the
position it is to occupy must also be taken into consideration; it must
be designed for its place; and, to get the best result, its place must
even be designed for it.
Socially morally and artistically one of the most necessary reforms
to-day is that we should simplify our lives; we should shake
ourselves free from all this hampering web of artificialities in which
we have become so degradingly entangled: and in our homes we
must make this possible for ourselves by first sweeping away all
these fussy substitutes for ornament, all these supposed indications
and requirements of refinement. Then, when we have done this, we
must set ourselves to make those things which are necessary and
helpful to real life and true refinement also beautiful.
But have you ever seen the ordinary room with nothing but the bare
necessaries of educated and refined life in it? I can assure you the
effect is not comfortable. And it is not to be wondered at that people
condemned to live in such rooms should try to supplement their
baldness by all sorts of added ornament and bric-à-brac. Some time
ago a picture dealer was looking at some of our designs for rooms,
and he said: “Yes, but it cannot be expected that I should admire
them. You, and those who follow your teaching are the worst
enemies I have. I want people to have houses of the ordinary type,
that they may always be trying in vain to make something of them,
by patiently buying & buying in the hope that by adding first this
then that some approach to a satisfactory result may be obtained.
Each of these rooms is in itself a complete and satisfactory whole:
there is no temptation to add anything.”
Lest the foregoing should give any the impression that I do not find
places for pictures, I will let this bring me to what sooner or later
this evening I shall be called upon to justify myself in, namely, the
amount of realism I admit in a picture to which I accord a place as
an element of decoration. I hold that the degree of
conventionalisation justifiably demanded in any decoration is only
such as is necessitated by the following: The limitations of the
materials and the processes by which it is to be produced; a just
appreciation of the special beauties of these materials and
characteristics of these processes; and a full recognition of its proper
relations to all by which it will be surrounded, and with which it is to
be combined as a component part of an architectural whole. There is
no need for adding any further artificial restrictions. But as a
legitimate reason for convention I would add a perfectly frank
acknowledgment of considerations of economy. If you use one
process in preference to another because it is less costly, there is no
occasion to disguise this. But, spite of the convention justified by this
needful economy, seek to retain something of the effect which the
motif that gave the inspiration had upon you.
The easel picture hung on the walls of our houses is certainly
unsatisfactory; that it is only more so when hung on the walls of an
exhibition all will admit: but that all the advance we have made in
our power to represent nature in realistic portraiture is in the wrong
direction we cannot admit. We may insist that our easel pictures
shall be regarded as complete in themselves, and thought of as
detached & dissociated from all that surrounds them; but this is
demanding an impossibility: they must form part of a whole. We find
the easel picture is less unsatisfactory if we do nothing more for it
than consider its frame, the colour scheme of its setting and
surroundings with relation to it: give it a definite place made for it,
and it is better still. But let us add to all its other dignity this too,
that it fulfils all the demands made upon it in its capacity as an
element of decoration, and it will be by so much the greater. The
imaginative picture, or the picture giving a bit of nature with her
mood, and having something of the effect upon one the real scene
would have, only gains by being at the same time also decorative.
And it is equally true that if decoration, by the suggestion of a
beautiful scene, can also have upon us something of the uplifting
effect such a scene would have, as a decoration it is finer.
Do not let us have convention pure and simple. If we are to retain all
that art has gained in the development of the easel picture, we must
face the problem fairly, not shirk it. Let us first have something
which we feel to be really beautiful, and then let us suffer it to
undergo only such conventionalisation as is dictated naturally by the
conditions and processes of its production, the limitations of the
materials from which it is to be created, and a true feeling for
fitness; never losing sight of the essential elements of the beauty of
our motif and the factors in creating that beauty, and sacrificing
nothing we can help of its meaning and charm.
BARRY PARKER.
OF FURNITURE. Part 2.
HERE is one point touched upon by Mr. Parker in
his paper, about which I should like to say a few
words: I refer to the question of simplicity in
furnishing. I feel that in showing to an assembly
of art workers many of the illustrations which we
wish to show, some further explanation on this
point is due.
There may be rooms required for state purposes in the palaces of
kings or the mansions of the great, which call for elaborate & very
ornate furnishing: such I do not propose now to consider. I would
refer rather to the homes of average middle-class people, where this
style of furnishing would be out of place.
Such people have usually thought it necessary for their houses to
contain several sitting-rooms, calling them dining-room, drawing-
room, and breakfast-room, although the means at the disposal of
the great majority would not allow three decent rooms; and the
desired number could only be obtained by reducing them all to tiny
box-like chambers, not one of them large enough to make a
comfortable living apartment. From this supposed necessity has
sprung the typical modern suburban residence, which consists of a
series of these small box-like chambers more or less cleverly fitted
together; while to meet the demand thus caused, we find the
warehouses filled with ready-made furniture, supposed to be
suitable to these rooms, inscribed “drawing-room suite,” “dining-
room suite,” and so on. These also I will not consider; they have no
interest, no actual touch on life. Such houses and the furniture which
is made for them are no more fitted to the lives of nine out of ten
middle-class families than would be the old hall and solar of the
middle ages with their rude fittings. My contention is that the great
majority of middle-class families live in one sitting-room. It is even
pathetic to watch their attempts to do this in houses which seem
specially designed to make it as difficult as possible. Many make the
dining-room serve them for a living-room, wasting the best room in
the house by keeping it vacant, except on more or less state
occasions; others live in the drawing-room, taking their meals only in
the dining-room. But whatever the arrangement, they all alike seem
to be hampered for want of a good comfortable living-room
designed and furnished as such.
I want specially to speak of rooms of this class, in the designing and
furnishing of which we are at once brought into touch with the daily
life of the household, and have scope to consider and meet their
actual requirements. In such a room, if they possessed it, most
families would take some at any rate of their meals; suitable table
and seats must therefore be provided, with something of the nature
of a sideboard or dresser to hold the many accessories which are
most conveniently kept in the room. The ladies would do their work
here and should have cupboards or other provision for their
numerous apparatus. A piano and place to keep music will generally
need providing; while book shelves, cupboards or drawers for
newspapers and magazines, will be required; and some kind of
writing table or bureau properly fitted to contain the household
stationery & business papers would mostly be a great boon. The
room too should have cosy seats, and something in the way of a
sofa or settle as the family will sit and rest here; and these must be
comfortably placed in relation to the fire, door, and windows. A place
would not uncommonly have to be found for children to spend at
any rate part of the day, which implies a toy drawer and some space
for play.
It is of course only in the smaller middle-class house—which by the
way is numerically far the most important—that the whole of the
family life is carried on in one sitting-room: but the need of a good
living-room is none the less felt in many a larger house where the
means of the occupants will allow of their having more rooms than
one in regular use. In such houses some of the functions of the
living room will no doubt be provided for separately. There will be a
nursery or play-room for the bairns in one house; a special room for
meals in another: in one, afternoon callers will be received in a
boudoir; in another, a study or library will be set apart for more
studious pursuits; while the tastes of some families may demand a
room set apart for music. But whatever rooms may be added, still, in
the great majority of cases, there will be needed one to serve as a
general living-room. Just as in the middle ages the great hall was
the centre of the house, all the other chambers clustering round and
being subordinate to it; so in the modern middle class house a good
living room is the first essential, and all the other rooms should be
considered in relation to it.
This living room requires furniture and fittings specially suited to its
various functions, and its requirements can no more be met by a
suite of dining-room or drawing-room furniture than they could by a
set of kitchen things. If we remember that large numbers of such
houses as we are speaking of are worked with one servant, and the
majority with not more than two; it will be obvious that this room,
which in so many cases will be used for an early breakfast, must be
so arranged that it can be easily and quickly cleaned. If we consider
further the great number of articles that must be kept handy in such
a room, to say nothing of the people themselves who are to occupy
it—for whom after all the room exists, and as a back-ground for
whose life it alone has any reason for being—it will be evident that
the furniture cannot well be too simple.
If the result is not to become a crowded jumble, ample allowance
must be made, in considering the decorations and furnishing, for the
life that is to come into the room, and for the hundred and one
articles which we may call the implements of such life. These of
themselves must form a large element, good or bad, in the
decoration of a room; and could they all be obtained graceful and
beautiful, there would be a liberal supply of ornament. But this is
one of the greatest difficulties; for, while it is possible to find
beautiful plaster-work, carving, gesso panels, and so forth, it is
almost impossible to obtain the necessary implements of life even
tolerably elegant.
In vain do we seek to make a room look beautiful by the elaboration
of its decoration and furniture, irrespective of all that goes to make
up the life that will be lived in it. The successful room is the one
which looks well with all the life in it, not the one which looks its
best before it is occupied. It is only by making proper allowance for
this life that a living room can be made to look well. Great simplicity
is needed in the treatment of a room which may so soon become
crowded and restless; but which may also, if properly treated, be
more charming and homelike than any other, just because it is so full
of life and the evidences of life—a decoration after all by no means
to be despised.
RAYMOND UNWIN.
BUILDING & NATURAL BEAUTY.
ROUND the cottage I live in there is a large
rookery, spreading over many trees which form a
small wood on the hillside. Last year a pair of
rooks began to build a nest in a beech-tree that
stands by the cottage: they chose a large bough
over-hanging the road, quite away from the
general colony, and in a very prominent position.
This was evidently the cause of great annoyance to the black-coated
community, who again and again destroyed the half-built nest. The
enterprising pair maintained their position however; and after some
weeks of contention got the nest completed, by working in turns,
one mounting guard while the other fetched the twigs. They reared
their family without further molestation, so far as I could observe;
but this spring the first thing the rooks did was to destroy the last
remnants of the nest left by the winter storms.
This interesting little episode of rook life set me musing as to why
the community should object to this nest. I could only suppose that
its isolated and prominent position offended their sense of the
general fitness of things, and that they wished to guard against the
first beginnings of “Suburban Villadom.” If so, we must I think
commend alike their good sense and their good taste. For there is
nothing which it seems more hopeless to harmonize with natural
scenery than the modern town suburb. We find plenty of cities,
towns, and villages, castles, mansions, and cottages, which are a joy
in the landscape; but when a modern town begins to sprawl its
squalor or its suburban gentility out into the fields, what desecration
of scenery follows! Most people feel this without realising the cause
very fully. But if we look for it, we shall find that modern suburbs
specially offend in coming between the town and the country; so
that, however the city may be fitted to beautify the landscape, we
cannot see it from the fields; nor can we catch a refreshing glimpse
of the cool green hillside from amidst our busy streets. For between
lie miles of jerry cottages built in rows, or acres of ill-assorted villas,
each set in a scrap of so-called landscape garden.
In the old towns which we admire when we chance to come on
them, we notice that the country comes up clean and fresh right to
the point where the town proper begins: and it does begin indeed:
honest town, confessed, which does not seek to look half-
countrified. In the oldest cities we sometimes find a wall with the
country coming right up to the gates, which adds to this effect. In
old times all the townspeople lived in the town, and tried to make it
comely as a town; and when this was done it generally looked
pleasing in the landscape. It was possible to get most charming
peeps of country from its streets—framed in perhaps with an old
gateway, or with some decent town buildings. Of our modern
citizens, all who can afford it live outside the town, removed from
those who work to make them wealthy. Hence they lose interest in
the town as a dwelling-place, and we get a great central business
quarter, surrounded by the residential suburbs containing only poor
town buildings or nondescript half-country dwellings. It is not
however with suburbs only that we spoil scenery; in isolated
buildings, or groups of buildings, we very often put up what is
offensive to the lover of country; and it will I think be both
interesting and useful to enquire a little further why the buildings
which our forefathers put up mostly adorn a landscape, while our
own erections so frequently spoil it.
Much of the charm of old buildings is no doubt due to the kindly
hand of Time, which not only heals the scars that man makes on the
earth, but tones down the raw surfaces, and softens the hard lines
and colours of anything he may build. But not to Father Time can we
give all the credit. It will be more than he can do, I think, to make
our modern suburbs look as beautiful, as fitting in the scenery, as
many an old city or country town does. Apart from the question of
beauty in the style of building, which of course is an obvious factor
of great influence, there are a few more easily understood reasons
for the difference between old and new. If we take for example their
position: do not old houses and villages generally seem to nestle in a
valley, under a hill, or by the edge of a wood or copse, and both by
their placing and style convey the idea of shelter and retreat?
Sometimes this characteristic was carried so far, that we find houses
placed so as to get little or no view. But they were built for busy
people who lived mainly out of doors, and returned to their shelter
at night as the rooks come home to roost. Too often now we place a
building so as to strike a note of defiance with surrounding nature.
The thing stands out hard and prominent in the landscape; shouts at
you across the valley; and through not co-operating with the scene,
fails to convey anything of that sense of nestling in a fitting nook, or
on an appropriate ledge—that sheltering under Nature’s wing as it
were—which makes a building look really at home.
Then, too, does not the old building seem almost to grow out of the
ground on which it stands? Built of the local stone; roofed with
material common to the district—thatch, stone shingles, or grey
slates, perhaps; harmonizing in colour with the rocks and soil; it is
as appropriate to the earth on which it rests, as the twig built nest of
the rook is to the tree top on which it sways so lightly and yet so
securely.
As we pass from county to county, rejoicing in the unspoilt bits of old
villages and towns, we cannot but notice how much of the restful
quiet beauty is due to the general harmony. We see the grey stone-
roofed village of Yorkshire and Derbyshire, so quietly fitting to the
country of rocks and stone walls; the green slate of Cumberland and
Westmoreland, that country of bright colouring; the thatch of
Shropshire or Somerset, always cosy and homely looking, whether
on the timber-framed building or on the whitewashed cottage; or
again, the purple slates of North Wales, unobtrusive among the dark
blue shadows of her towering peaks, and fitly covering in the
cottage whose walls are of rough slabs of the same slate. The red
tile, too, coloured with the iron which tints the soil, more widely
distributed and in greater variety than any of the roof coverings,
though not exactly a natural product only needs to be clothed with
the golden green of the lichen to look as much at home as any of
the rest: we know it well in Staffordshire, and to think of Whitby
without its red roofs is to realise at once what beauty it can give to a
scene. Each of these roof coverings has a special beauty of its own;
some look well almost anywhere; but we do not always realise how
much of roofs we see in a landscape, or to what extent the restful
charm of old places springs from their harmony with surroundings
and the general prevalence of one material in the district.
Our fathers were not tempted as we are in this. They had to use the
local material and to stick to it. There were no railways in their time
carrying blue slates to Whitby, or red tiles to North Wales. Now all
these materials are brought to our doors, and the builder chooses
each according to his own fad; and so we get all sorts of materials
and colours hopelessly jumbled up together, with no thought of
general harmony.
Our manufactured materials too are less beautiful. Our tiles by
perfect machinery are made so true and flat that a modern tile roof
looks as though it had been ironed with a polishing iron, like a shirt
front. And both our tiles and bricks tend to become so hard and
forbidding that no kindly lichen will clothe them, no wind and rain
soften and tone them. It gives one something of a shock to see the
delicate clematis and the clinging ivy struggling with a wall which,
after twenty or thirty years, still looks as hard and new as the day it
was built. The old tiles were a little curled in burning, and had a
surface rough enough to afford lodgment for moss and lichen; and
so the lines were less hard, and the newness of surface and colour
soon mellowed into all sorts of lovely shades.
Many an old building that has little pretension to fine architecture,
yet adorns a scene of natural beauty by its simple fitness of design,
where a modern one would probably spoil it. Such design was the
outcome of a natural effort to get the most use and convenience out
of materials thoroughly known. Hence a general suitability is found
between design and material, and an obvious connection between
quaint features and the want that has called them into being. Look
at the plainest old four-square thatched cottage, and there will
nearly always be some interest in the way the thatch has been
coaxed up over a window, or a ridge worked to avoid a chimney
gutter, which redeems it from baldness. The same skilful handling of
tiles is found in all real tile districts; and so we find many
picturesque gables, which we should miss in a country of slates or
stone shingles.
There is on all hands evidence of a willingness to give labour without
stint; to do a job well and a bit more; to linger over it, and see if a
little more work here and there would not improve the look. In fact,
we read in these old buildings, as in an open book, of a simple
workman who was something of an artist, one who could take
pleasure in his work, finding joy in the perfection of what he
created, and delight in its comeliness.
Whenever we again raise up such an army of builders, working at
their trades with the pleasure of artists, then will all buildings
become as beautiful as of old; then will it be possible for such
workmen, co-operating with a true architect or master builder, to
raise fine architecture, like our old cathedrals and abbeys. No effort
of office-trained architects, with workmen whose chief interest on
the job is to find ‘knocking-off time,’ can ever take the place of the
co-operation between real craftsmen under the leadership of the
most able among them: for it is to this that we owe most of the
building that we can truly say adorns our country.
RAYMOND UNWIN.
CO-OPERATION IN BUILDING.
S beautiful as an old English village.” The phrase
arrests our attention and calls up many a
pleasant picture stored in our minds; but with the
remembered beauty there comes too the
associated sadness of something loved that is fast
passing away. The picture we recall may be the
view down some long wide village street
bordered with clusters of cottages, some opening direct on to the
roadside, some with their bright bits of flower border in front; here
and there a break in the buildings is marked with the dark foliage of
trees in a larger garden; a dignified forecourt with its iron railings
reveals an old manor house, or a gate-way in a high wall overhung
by elms leads to the vicarage; while at the street end where the
road turns away is the lich-gate, leading to the church whose
parapetted roof and slender spire rising far above all the surrounding
buildings complete the whole group. Or maybe we picture to
ourselves rather some village green, with the rows of sunny
whitewashed houses, the barns and haystacks of an occasional
farmyard, the end of an orchard, and the village school, that are
gathered round it.
In such views as these there are houses and buildings of all sizes:
the hut in which the old road-mender lives by himself, the inn with
its ancient sign, the prosperous yeoman’s homestead, the
blacksmith’s house and forge, the squire’s hall, the vicarage, and the
doctor’s house, are all seemingly jumbled together; and mingled
with them are barns and village shops, wood-yards and wheel-
wrights’ sheds. Yet there is no sense of confusion; on the contrary
the scene gives us that peaceful feeling which comes from the
perception of orderly arrangement. This is the more surprising
because the order is rather intuitively felt than seen or consciously
realised by the beholder. It is due very largely to the beautiful
grouping of buildings and roofs, a grouping which has come so
inevitably that it seems as if it would be somewhat difficult to avoid
it, or to utterly spoil it. Certainly where many buildings of various
characters and sizes are gathered together, as in a village, a
picturesqueness of grouping is rarely absent even when the
individual buildings have in themselves no special beauty; and very
often the introduction of one or two really ugly modern buildings
detracts little from this particular charm.
The village was the expression of a small corporate life in which all
the different units were personally in touch with each other,
conscious of and frankly accepting their relations, and on the whole
content with them. This relationship reveals itself in the feeling of
order which the view induces. Every building honestly confesses just
what it is, and so falls into its place. The smallest cottage has its
share of the village street on to which the manor house also fronts.
It is content with that share and with its condition, and does not try
to look like a villa. It is this crystallisation of the elements of the
village in accordance with a definitely organized life of mutual
relations, respect or service, which gives the appearance of being an
organic whole, the home of a community, to what would otherwise
be a mere conglomeration of buildings. This effect is greatly
enhanced where the central feature around which the village has
clustered, the church, castle, or manor house, is of sufficient size
and architectural interest to challenge comparison with the whole
village rather than with the individual houses. The impressive pile of
the old Priory as seen across the valley towering above all the other
grey roofed buildings of the little town of Cartmel, is a fine example
of this. The sense of unity is further increased in most old villages by
a general harmony in colour and style of the buildings themselves,
due to the prevalent use of certain materials, which are usually
those found in the district.
In the modern building-estate all these elements of beauty are
entirely wanting. The land is cut up into little plots all about the
same size; these are sold to a chance collection of people who erect
on them houses of any conceivable style, or lack of style; each deals
with his own plot quite regardless of the others; and every house
seems to be wishing to dissociate itself as much as possible from its
neighbours, to look as distinct and imposing as it can. Ground
enough not being allowed for each house to stand comfortably
within its plot, such separation as exists only makes it possible for
every house to block the view from some other, and easy for the
occupants to over-look their neighbours and realise their near
presence all round to a maximum extent. No grouping of buildings is
thought of nor any organized arrangement, beyond occasionally
some feeble attempt at laying out streets; and it is rarely indeed that
we seem able to erect a public building of any sort at all in scale
with the extent of the surrounding houses.
To compensate for the loss of the interest springing from variety of
grouping, a loss specially evident in the old-fashioned four-square
suburban villa, an attempt is now mostly made to introduce some
special features into each individual house, and so to create an
artificial picturesqueness. This is not uncommonly done by
needlessly cutting up the roof with turrets from which there is no
outlook, or gables which serve no purpose except to provide an
excuse for a little black and white half-timber work. A street of such
houses is however even less satisfactory than one of the old square
box houses, in that it is more artificial, and lacks a certain element of
dignity which its predecessor often acquired from its very simplicity.
In short, around all our towns are spread patches of villadom of the
beauty of which no one can cherish any memories, but the ugliness
of which causes them to be regarded by many with a cordial hatred;
so much so that to the lover of natural scenery the commencement
of a new house is regarded as a sure sign of the coming destruction
of the old beauty.
Modern conditions of life and work are not conducive to the
production of great architecture, and it seems probable that we shall
have to await some change in these conditions before much that is
really fine in building will be accomplished. But in the simpler
buildings required for domestic purposes there are marked signs of
improvement. Already a few architects are meeting our wants
without affectation or pedantry, but with simple directness and
honesty of construction, and are producing individual buildings of
great beauty; but so long as these remain isolated examples, mere
units in a chance collection, they can do little to help the whole
effect. The various buildings must be brought into harmonious
relations one with another; the suburb or settlement must be
conceived in some broader spirit and developed in relation to a
definite idea of the whole, if any improvement is to be effected.
We cannot of course put back the hands of time, nor can we re-
create the spirit which built the old churches that crown so many
villages. The relationships of feudalism have gone, and democracy
has yet to evolve some definite relationships of its own, which when
they come will doubtless be as picturesque as the old forms. But
allowing full force to these disadvantages, we could, if we really
desired it, even now so arrange a new building site that it should not
be an actual eye-sore, and might manage that it should have some
little of the charm of the old village.
Thanks to the growth of taste among all classes of people there is
springing up a demand for something of the kind. In all the large
towns are numbers of people who hate the ugly & dreary life that
they are condemned to live in them, who love the country and
country life, and who will travel long distances to and from their
work that they may be able to enjoy them. These people do not
want to live in isolated houses, out of sight of their neighbours; they
are townspeople of sociable instincts: but neither do they desire to
live in a mere extension of the fringe of the town. What they really
want are country villages, little centres of life large enough and
varied enough to give them interesting human society and a few of
the more necessary comforts of modern life, such as a post office, a
railway station, efficient drainage and water supply. These people
have many common interests, much that all would wish to preserve
in a new home, as, for example, fresh air, and an open view of
country that cannot readily be spoilt. Just such an amount of
associated action as would ensure these advantages for them all,
would suffice to give the sense of cohesion to the whole settlement
which is so lamentably wanting when each struggles ineffectually to
secure as much as he can of them for himself alone. With some co-
operation the maximum of these advantages could be obtained for
every individual house, be it large or small; without it none but those
rich enough to purchase a large tract of country for themselves can
be secure of even a limited share of them.
Within easy reach of large towns, estates & farms are constantly
changing hands at prices little above their value as agricultural land.
Frequently we find the enterprising purchaser takes advantage of
the demand for country homes: he spends a few hundred pounds in
developing his purchase as a building estate, by making roads and
laying drains; then he cuts it up into small plots and sells it at three,
five, or even ten times the rate at which he bought it. If a few of
those who wish to secure a country home were to purchase such an
estate or farm among them, they could get all the advantage of
cheap land themselves. If they were then to develop the site on co-
operative lines, they could obtain many other equally solid
advantages. The houses could be grouped together and so arranged
that each would obtain a sunny aspect and an open outlook; and
portions of the land could be reserved for ever from being built upon
to secure these views.
See plates 11, The arrangement that should be adopted to obtain
38 and 39. the best result, would depend entirely on the nature
of the site. If it were on the ridge of some rising
ground, probably the best plan would be to group the houses at
each side of a good broad roadway, taking the wide village street as
the suggestion; while on a good southern slope, the most successful
plan might be to gather the houses and other buildings on three
sides of an open space, adopting the village green as the model.
Where the site was large enough, and the slope sufficient, a second
green with its houses could be arranged, low enough not to obstruct
the view from the upper one; or where two sides of a valley were
included, villages might be placed on each of the slopes, leaving the
valley below for ever free to afford a pleasant prospect for each
village. The particular arrangement to be adopted would be a matter
for most careful thought, and no building should be commenced
until some definite conception of what the completed village was to
be like had been worked out. The sites for prospective schools,
church, or other public buildings, should be reserved from the first,
in accordance with the size to which the available land would allow
the community to grow. The houses should be clustered together as
much as possible, not set villa-wise each in the centre of a little plot.
Some few houses of wealthier members could stand back in larger
grounds, taking advantage of outlying positions or sharing in the
common outlook as seemed best: their gardens and entrances would
make pleasant openings in the buildings. But the majority of the
houses should be gathered into groups, which would inevitably
acquire picturesqueness from the variety both in size and form of the
buildings.
A good number of the houses too might be open to the road or
green. The unfenced common coming right up to one’s doorstep,
always gives a charming sense of openness whether viewed from
within or from without; a sense in no way diminished by the contrast
that occasional fenced gardens or forecourts offer where the houses
are set back somewhat. All sorts of individual tastes and needs
would afford opportunity for obtaining variety: the one thing to be
avoided at all costs would be the producing of anything like a street
of detached villas.
The common insatiable desire for detachment is very remarkable; it
appears to arise mainly from a resigned acceptance of the jerry
builder’s party wall as the inevitable one. Everyone suspects a party
wall, looks to hear through it his neighbour’s child in the dead of
night, or his piano on a Sunday afternoon. Guarantee a sound-proof
party wall, and few will be able to give any valid reason why there
should be from ten to fifty feet of useless ground between every two
houses. In a properly built house, one is really much less conscious

You might also like