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
PDF
추천시스템 이제는 돈이 되어야 한다.
PPTX
Spring Security 5
PDF
Building Reusable SwiftUI Components
PDF
인공지능추천시스템 airs개발기_모델링과시스템
PPTX
d.ts 만들기
PPTX
모두가 성장하는 스터디 만들기
PDF
Little Big Data #1. 바닥부터 시작하는 데이터 인프라
Design for succcess with react and storybook.js
추천시스템 이제는 돈이 되어야 한다.
Spring Security 5
Building Reusable SwiftUI Components
인공지능추천시스템 airs개발기_모델링과시스템
d.ts 만들기
모두가 성장하는 스터디 만들기
Little Big Data #1. 바닥부터 시작하는 데이터 인프라

What's hot (20)

ODP
Json Tutorial
PPTX
PDF
REST APIs with Spring
PPTX
Introduction to D3.js
PPT
TypeScript Presentation
PPTX
jQuery
PPTX
Selenium WebDriver training
PDF
Docker 간단 개념 / Docker 를 이용한 MSA 기반의 Spring Boot 프로젝트 - DSmentoring 정다운
PDF
Recommendation System History
PPT
Presentation Spring, Spring MVC
PPTX
iOSDC 2018 動画をなめらかに動かす技術
PDF
Random Thoughts on Paper Implementations [KAIST 2018]
PPTX
.Net Core
PDF
flutter.school #HelloWorld
PDF
성장을 좋아하는 사람이, 성장하고 싶은 사람에게
PDF
Learn D3.js in 90 minutes
PDF
고려대학교 컴퓨터학과 특강 - 대학생 때 알았더라면 좋았을 것들
PPTX
Typescript ppt
PPTX
Vue js for beginner
PPTX
JSON: The Basics
Json Tutorial
REST APIs with Spring
Introduction to D3.js
TypeScript Presentation
jQuery
Selenium WebDriver training
Docker 간단 개념 / Docker 를 이용한 MSA 기반의 Spring Boot 프로젝트 - DSmentoring 정다운
Recommendation System History
Presentation Spring, Spring MVC
iOSDC 2018 動画をなめらかに動かす技術
Random Thoughts on Paper Implementations [KAIST 2018]
.Net Core
flutter.school #HelloWorld
성장을 좋아하는 사람이, 성장하고 싶은 사람에게
Learn D3.js in 90 minutes
고려대학교 컴퓨터학과 특강 - 대학생 때 알았더라면 좋았을 것들
Typescript ppt
Vue js for beginner
JSON: The Basics
Ad

Viewers also liked (11)

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

Similar to React storybook (20)

PDF
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
PDF
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
PPTX
Getting Started with React v16
PPTX
Making React Native UI Components with Swift
PPTX
Academy PRO: React native - building first scenes
PDF
Vue JS @ MindDoc. The progressive road to online therapy
PDF
Deep dive into Oracle ADF
PPTX
Java Training Ahmedabad , how to Insert Data in Servlet, iOS Classes Ahmedabad
PDF
Improving android experience for both users and developers
PDF
Droidcon2013 android experience lahoda
PDF
2013-06-25 - HTML5 & JavaScript Security
PDF
Using Renderless Components in Vue.js during your software development.
PDF
HTML5 & The Open Web - at Nackademin
PDF
Bootiful Development with Spring Boot and React - SpringOne 2017
PDF
Bootiful Development with Spring Boot and React - RWX 2017
PPT
Test Infected Presentation
PPTX
Introduction to React
KEY
Writing your Third Plugin
PPT
What do you mean it needs to be Java based? How jython saved the day.
PDF
Lessons from a year of building apps with React Native
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
[Flutter] 來體驗 bloc 小方塊的神奇魔法 @Devfest 2022
Getting Started with React v16
Making React Native UI Components with Swift
Academy PRO: React native - building first scenes
Vue JS @ MindDoc. The progressive road to online therapy
Deep dive into Oracle ADF
Java Training Ahmedabad , how to Insert Data in Servlet, iOS Classes Ahmedabad
Improving android experience for both users and developers
Droidcon2013 android experience lahoda
2013-06-25 - HTML5 & JavaScript Security
Using Renderless Components in Vue.js during your software development.
HTML5 & The Open Web - at Nackademin
Bootiful Development with Spring Boot and React - SpringOne 2017
Bootiful Development with Spring Boot and React - RWX 2017
Test Infected Presentation
Introduction to React
Writing your Third Plugin
What do you mean it needs to be Java based? How jython saved the day.
Lessons from a year of building apps with React Native

Recently uploaded (20)

PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
additive manufacturing of ss316l using mig welding
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Digital Logic Computer Design lecture notes
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Sustainable Sites - Green Building Construction
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
UNIT 4 Total Quality Management .pptx
CYBER-CRIMES AND SECURITY A guide to understanding
additive manufacturing of ss316l using mig welding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
R24 SURVEYING LAB MANUAL for civil enggi
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Digital Logic Computer Design lecture notes
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Lecture Notes Electrical Wiring System Components
Embodied AI: Ushering in the Next Era of Intelligent Systems
CH1 Production IntroductoryConcepts.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Model Code of Practice - Construction Work - 21102022 .pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Sustainable Sites - Green Building Construction
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Construction Project Organization Group 2.pptx
UNIT 4 Total Quality Management .pptx

React storybook