Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
React Containers - South Bay JS
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Eli
February 10, 2016
Technology
51
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React Containers - South Bay JS
Lightning talk about using "containers" in reactjs to create reuseable components.
Eli
February 10, 2016
More Decks by Eli
See All by Eli
Secure Peer-to-Peer Browser Communication
emattson
0
53
Other Decks in Technology
See All in Technology
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
150
その Valkey 使いこなしていますか?
onk
PRO
1
220
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
1
250
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
事業活動を AI Ready にする攻めと守りのデータエンジニアリング / data-engineering-for-ai-ready-business
pei0804
7
2.7k
今さら理解するウェブフォントver.2026
takanorip
3
690
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
350
味覇で作るパスタが美味い - 20261001_yabaubuki.dev
livesense
PRO
0
130
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
720
大型犬好きによるPugの紹介
yamanoku
1
150
WasmをRustにする
sansantech
PRO
0
220
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
110
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
250
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
The Invisible Side of Design
smashingmag
301
52k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
WCS-LA-2024
lcolladotor
0
880
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
700
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Transcript
Reactjs and containers Eli Mattson @elicodes
What is React? A JavaScript library for building user interfaces
JSX
CommentList Component class CommentList extends React.Component { constructor() { super();
this.state = {comments: [], title: ''}; } componentDidMount() { $.post('/echo/json/', {json: JSON.stringify(jsonData), delay: 1}) .done(d => this.setState({comments: d['comments'], title: d['title']})); } render() { let comments = this.state.comments.map(c => (<li>{c.body} - <em>{c.author} </em> </li>)); return ( <div> <h2> {this.state.title} Comments </h2> <ul> {comments} </ul> </div> ); } } React.render(<CommentList />, document.getElementById('test'));
CommentList Component class CommentList extends React.Component { constructor() { super();
this.state = {comments: [], title: ''}; } componentDidMount() { $.post('/echo/json/', {json: JSON.stringify(jsonData), delay: 1}) .done(d => this.setState({comments: d['comments'], title: d['title']})); } render() { let comments = this.state.comments.map(c => (<li>{c.body} - <em>{c.author} </em> </li>)); return ( <div> <h2> {this.state.title} Comments </h2> <ul> {comments} </ul> </div> ); } } React.render(<CommentList />, document.getElementById('test'));
Our App Component A Component A Component A Component A
CommentList Component class CommentList extends React.Component { constructor() { super();
this.state = {comments: [], title: ''}; } componentDidMount() { $.post('/echo/json/', {json: JSON.stringify(jsonData), delay: 1}) .done(d => this.setState({comments: d['comments'], title: d['title']})); } render() { let comments = this.state.comments.map(c => (<li>{c.body} - <em>{c.author} </em> </li>)); return ( <div> <h2> {this.state.title} Comments </h2> <ul> {comments} </ul> </div> ); } } React.render(<CommentList />, document.getElementById('test'));
Our App Component A Component A Other App Component A
Component A
None
The Solution! Use a container to handle the state and
render the corresponding sub- component as a “pure” component.
Component A Component A Component A Container State goes here
ONLY props goes here
TO THE CODE!!!!! https:/ /jsfiddle.net/elicodes/m9z3y2ve/
Credits / Links https:/ /medium.com/@learnreact/ container-components- c0e67432e005#.yvdmzmwsp https:/ /www.youtube.com/watch? v=KYzlpRvWZ6c
- Jason’s talk