SlideShare a Scribd company logo
STORYBOOK
&
REACT NATIVE
Jair Trejo
WHO AM I?
Jair Trejo
Full-stack developer at Chegg
@jairtrejo on Twitter
2
WHAT IS REACT
STORYBOOK?
4
5
import	React	from	'react';	
import	{	View	}	from	'react-native';	
import	{	storiesOf,	action	}	from	'@kadira/react-native-storybook';	
import	{	SpeechBubble	}	from	‘../../components/SpeechBubble’;	
storiesOf(‘SpeechBubble');	
		.add('default	view',	()	=>	(	
								<View	style={{width:	300}}>	
												<SpeechBubble	message="Default,	explanatory	bubble"	
																										severity={	SpeechBubble.SEVERITY.INFO	}	
																										tailPosition={	50	}/>	
								</View>	
				))	
				.add('warning',	()	=>	(	
								<SpeechBubble	message="Watch	out!	Something	unexpected	just	happened"	
																						severity={	SpeechBubble.SEVERITY.WARNING	}	
																						tailPosition={	50	}/>	
				));
6
7
A tight feedback loop for
developing new components and
new states for those components.
8
A clear, convenient place to
communicate and collaborate with
designers.
9
A place where you can visually
check that everything works and
looks as intended.
HOW IS IT USEFUL TO ME?
REACT NATIVE STORYBOOK
11
12
13
14
15
16
const	simpleFavorite	=	new	Favorite({	
				id:	'1',	
				title:	'Learning	React	Native…’,	
				url:	'https://amzn.com/1491929006',	
				shortUrl:	'amazon.com/gp/product/149…',	
				source:	new	Source({	
								type:	'tweet',	
								id:	'707050076170891264',	
								from:	new	Friend({	
												name:	'Bonnie	Eisenman',	
												username:	'brindelle'	
								})	
				}),	
});	
storiesOf('FavoriteDetail')	
				.add('default	view',	()	=>	(	
								<FavoriteDetail	favorite={	simpleFavorite	}	
																								onBack={	action('Go	back')	}	
																								onFavoritePress={	action('Favorite	pressed')	}	
																								onShare={	action('Share')	}/>	
				));
17
linkTo
18
19
20
21
22
State
HTML
VDom
UI
23
24
export	default	connectComponent(	
				(state$)	=>	({	
								favorites:	state$.map('.getIn',	['feed',	'favorites']),	
								refreshing:	state$.map('.getIn',	['feed',	'lastFetched'])	
																										.map(d	=>	d	===	null)	
				}),	
				()	=>	({	
								onFavoritePressed:	asActionType('FAVORITE_SELECTED'),	
								onRefresh:	asActionType('FETCH_FAVORITES'),	
				})	
)(Feed);
25
export	class	Feed	extends	Component{	
.	.	.	
}	
export	default	connectComponent(	
.	.	.	
)(Feed);
26
27
28
HOW CAN YOU START
USING IT?
KADIRAHQ/REACT-STORYBOOK
30
31
32
import	{	storiesOf,	action	}	from	'@kadira/react-native-storybook';	
import	{	Favorite	}	from	'../../components/Favorite';	
storiesOf('Favorite')	
				.add('default	view',	()	=>	(	
								<FavoriteComponent	favorite={	simpleFavorite	}	
																											onPress={	action('Favorite	pressed')	}/>	
				));
33
storiesOf('Favorite')	
				.addDecorator((story)	=>	(	
								<View	style={{	
												flexDirection:	'column',	
												alignItems:	'stretch',	
												justifyContent:	'center',	
												flex:	1}}	
								>	
												{	story()	}	
								</View>	
				));
34
35
36
37
A tight feedback loop for
developing new components
and new states for those
components.
A clear, convenient place to
communicate and collaborate
with designers.
A place where you can visually
check that everything works and
looks as intended.
THANK YOU!
Let’s stay in touch: @jairtrejo

More Related Content

PDF
Design for succcess with react and storybook.js
Chris Saylor
 
PPTX
Owl: The New Odoo UI Framework
Odoo
 
PDF
外部環境への依存をテストする
Shunsuke Maeda
 
PDF
Impact of the New ORM on Your Modules
Odoo
 
PPTX
Project Lombok!
Mehdi Haryani
 
PPT
Intro to HTML5 audio tag
satejsahu
 
PDF
MongoDB and Node.js
Norberto Leite
 
PDF
Express node js
Yashprit Singh
 
Design for succcess with react and storybook.js
Chris Saylor
 
Owl: The New Odoo UI Framework
Odoo
 
外部環境への依存をテストする
Shunsuke Maeda
 
Impact of the New ORM on Your Modules
Odoo
 
Project Lombok!
Mehdi Haryani
 
Intro to HTML5 audio tag
satejsahu
 
MongoDB and Node.js
Norberto Leite
 
Express node js
Yashprit Singh
 

What's hot (20)

PDF
Spring Ldap
Piergiorgio Lucidi
 
PPTX
Phpcon2015
Hiroshi Tokumaru
 
PPTX
Flask – Python
Max Claus Nunes
 
PPTX
MongoDB - Aggregation Pipeline
Jason Terpko
 
PDF
간단한 블로그를 만들며 Django 이해하기
Kyoung Up Jung
 
PDF
API for Beginners
Sébastien Saunier
 
PDF
Java persistence api 2.1
Rakesh K. Cherukuri
 
PPTX
Spring data jpa
Jeevesh Pandey
 
PDF
Rest api with Python
Santosh Ghimire
 
ODP
Formation PHP
kemenaran
 
PDF
Spring Batch
Kokou Gaglo
 
PDF
ES6: The Awesome Parts
Domenic Denicola
 
PDF
Flask Introduction - Python Meetup
Areski Belaid
 
PDF
Introduction to thymeleaf
NexThoughts Technologies
 
PDF
Introduction to Spring Boot!
Jakub Kubrynski
 
PDF
introduction to Vue.js 3
ArezooKmn
 
PDF
ReactJS
Hiten Pratap Singh
 
PPTX
Introduction à spring boot
Antoine Rey
 
PDF
Migration Guide from Java 8 to Java 11 #jjug
Yuji Kubota
 
DOCX
Odi interview questions
Udaykumar Sarana
 
Spring Ldap
Piergiorgio Lucidi
 
Phpcon2015
Hiroshi Tokumaru
 
Flask – Python
Max Claus Nunes
 
MongoDB - Aggregation Pipeline
Jason Terpko
 
간단한 블로그를 만들며 Django 이해하기
Kyoung Up Jung
 
API for Beginners
Sébastien Saunier
 
Java persistence api 2.1
Rakesh K. Cherukuri
 
Spring data jpa
Jeevesh Pandey
 
Rest api with Python
Santosh Ghimire
 
Formation PHP
kemenaran
 
Spring Batch
Kokou Gaglo
 
ES6: The Awesome Parts
Domenic Denicola
 
Flask Introduction - Python Meetup
Areski Belaid
 
Introduction to thymeleaf
NexThoughts Technologies
 
Introduction to Spring Boot!
Jakub Kubrynski
 
introduction to Vue.js 3
ArezooKmn
 
Introduction à spring boot
Antoine Rey
 
Migration Guide from Java 8 to Java 11 #jjug
Yuji Kubota
 
Odi interview questions
Udaykumar Sarana
 
Ad

Viewers also liked (11)

PDF
React Native Firebase Realtime Database + Authentication
Kobkrit Viriyayudhakorn
 
PDF
React-Native Lecture 11: In App Storage
Kobkrit Viriyayudhakorn
 
PDF
React Native Firebase
Kobkrit Viriyayudhakorn
 
PDF
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
Kobkrit Viriyayudhakorn
 
PDF
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
Kobkrit Viriyayudhakorn
 
PDF
Startup Pitching and Mobile App Startup
Kobkrit Viriyayudhakorn
 
PDF
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
PDF
[React Native Tutorial] Lecture 5: Input and State
Kobkrit Viriyayudhakorn
 
PDF
[React-Native Tutorial] Map
Kobkrit Viriyayudhakorn
 
PDF
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
Kobkrit Viriyayudhakorn
 
PDF
Lecture 2: ES6 / ES2015 Slide
Kobkrit Viriyayudhakorn
 
React Native Firebase Realtime Database + Authentication
Kobkrit Viriyayudhakorn
 
React-Native Lecture 11: In App Storage
Kobkrit Viriyayudhakorn
 
React Native Firebase
Kobkrit Viriyayudhakorn
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
Kobkrit Viriyayudhakorn
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
Kobkrit Viriyayudhakorn
 
Startup Pitching and Mobile App Startup
Kobkrit Viriyayudhakorn
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
[React Native Tutorial] Lecture 5: Input and State
Kobkrit Viriyayudhakorn
 
[React-Native Tutorial] Map
Kobkrit Viriyayudhakorn
 
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
Kobkrit Viriyayudhakorn
 
Lecture 2: ES6 / ES2015 Slide
Kobkrit Viriyayudhakorn
 
Ad

Recently uploaded (20)

PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PPTX
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PPTX
Introduction of deep learning in cse.pptx
fizarcse
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
PPTX
Color Model in Textile ( RGB, CMYK).pptx
auladhossain191
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
Inventory management chapter in automation and robotics.
atisht0104
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
Zero Carbon Building Performance standard
BassemOsman1
 
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
Introduction of deep learning in cse.pptx
fizarcse
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
Color Model in Textile ( RGB, CMYK).pptx
auladhossain191
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 

React storybook