Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
new version of context in React 16.3
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
sota ohara
March 30, 2018
1.9k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
new version of context in React 16.3
sota ohara
March 30, 2018
More Decks by sota ohara
See All by sota ohara
Re-Architecture of ReactNative
sottar
0
300
Implement prerendering w/ puppeteer
sottar
1
340
create own CMS from scratch
sottar
2
9.1k
Let’s try to hack AST of JavaScript
sottar
1
1.9k
フロントエンドエンジニアが伝えたい最近の事情
sottar
27
18k
複数人で高速に開発するためのnpmモジュール
sottar
5
2.7k
2ヶ月半でサービスをリリースした話し
sottar
2
2.3k
Redux のディレクトリ構成を考える
sottar
2
15k
モダンなJavaScriptアプリケーションでモダンにスタイリングする方法
sottar
9
5.1k
Featured
See All Featured
A Soul's Torment
seathinner
6
2.9k
Building Applications with DynamoDB
mza
96
7.1k
Designing Powerful Visuals for Engaging Learning
tmiket
1
410
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
250
Mind Mapping
helmedeiros
PRO
1
250
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
860
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Transcript
new version of context in React 16.3 - We Are
JavaScripters! @17th Mercari, inc. Frontend Engineer Sota Ohara
about me Sota Ohara / sottar Mercari, inc. / Souzoh,
inc. Frontend Engineer mercari NOW, CSTool @sottar_ sottar
React v16.3 is upcoming
React v16.3 is upcoming React v16.3 has released
React v16.3 has released https://twitter.com/reactjs/status/979458172833357825
• New life-cycle methods The functions that will be deprecated
are: • componentWillMount • componentWillUpdate • componentWillReceiveProps New method is: • static getDerivedStateFromProps • StrictMode API • AsyncMode • Update React DevTools • Update Context API ….. What’s new in React v16.3
New context API
• Typically, data in a React application is passed top-
down (parent to child) via props. • So, we also need to pass the related entire site values each layer components motivation it’s too painful !!
• The value set in the context can be acquired
from any child component. • New component types: Provider and Consumer. • Refer to the ancestor as the provider and the child as the consumer • Providers and consumers come in pairs New context API
Basic Sample
* A provider-consumer pair is created using * requires a
default value React.createContext() React.createContext()
* The provider accepts a context value as a prop
* In the typical scenario, context value has in state. and updated by calling setState. Provider
* The consumer uses a render prop API * In
the typical scenario, context value has in state and updated by calling setState. Consumer
FYI. What’s new in React 16.3(0-alpha) https://medium.com/@baphemot/whats-new-in-react-16-3-d2c9b7b6193b
We are hiring !!