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
Understanding Recompose through examples
Search
Olena Sovyn
November 26, 2017
Programming
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Understanding Recompose through examples
Olena Sovyn
November 26, 2017
More Decks by Olena Sovyn
See All by Olena Sovyn
Hidden Gems in Code Reviews
kiwka
0
59
Testing, tEstIng, TeStInG or how to test React apps with generated input data
kiwka
1
710
Empowering your React application with Flow type system
kiwka
0
60
Building Webflow Ecommerce in 3 stories
kiwka
0
99
Building a Chrome Extension with React
kiwka
0
770
On the way to making React components more reusable
kiwka
2
340
Using Facade pattern with JSX
kiwka
4
430
Other Decks in Programming
See All in Programming
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.6k
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
410
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
4.8k
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
380
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
360
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
130
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
140
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
110
Foundation Models frameworkで画像分析
ryodeveloper
1
120
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Typedesign – Prime Four
hannesfritz
42
3.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Writing Fast Ruby
sferik
630
63k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
400
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
150
Scaling GitHub
holman
464
140k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
220
First, design no harm
axbom
PRO
2
1.2k
Building Adaptive Systems
keathley
44
3.1k
Docker and Python
trallard
47
4k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
470
Transcript
Olena Sovyn (@frontendgirl) 6OEFSTUBOEJOH 3FDPNQPTFUISPVHI FYBNQMFT
Olena Sovyn (@frontendgirl) ! & "
❤ 3FBDU 3FEVY -PEBTI 3FBDU4UPSZCPPL GVODUJPOBMQSPHSBNNJOH
None
Olena Sovyn (@frontendgirl) 6OEFSTUBOEJOH 3FDPNQPTFUISPVHI FYBNQMFT
Image source: https://szenandoah.deviantart.com/art/Wonderland-Logo-252210579
None
ZFBSBHP
How to make complex component to be reusable
%BUB #FIBWJPVS 6* Reusable ???
)0$ (high order components)
)0$ changed: context or/and props
3FDPNQPTF
%BUB #FIBWJPVS 6* Recompose HOC Stateless component
None
Why should I care about Recompose
Image source: http://spacenews.com/spacexs-new-price-chart-illustrates-performance-cost-of-reusability/
None
Image source: https://whataboutjesus.com/jesus-is-the-only-way/
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
%VOOJOHr,SVHFSFGGFDU Confidence Wisdom first usage of one of Recompose HOCs
reading Recompose documentation trying to use Recompose on practice
None
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
None
None
None
branch lifecycle renderComponent renderNothing toClass mapProps withProps withPropsOnChange defaultProps renameProp
renameProps flattenProp withState withHandlers withStateHandlers withReducer shouldUpdate pure onlyUpdateForKeys onlyUpdateForPropTypes withContext getContext 1SPQT 4UBUF 1FSGPSNBODF 0UIFS $POUFYU 3FDPNQPTF )0$T
branch lifecycle renderComponent renderNothing toClass mapProps withProps withPropsOnChange defaultProps renameProp
renameProps flattenProp withState withHandlers withStateHandlers withReducer shouldUpdate pure onlyUpdateForKeys onlyUpdateForPropTypes withContext getContext 1SPQT 4UBUF 1FSGPSNBODF 0UIFS $POUFYU 3FDPNQPTF )0$T
None
None
None
None
None
None
None
https://www.youtube.com/watch?v=C_yj4k4QZVI
None
3FVTBCJMJUZ
MJGFDZDMF Image source: https://www.codevoila.com/post/57/reactjs-tutorial-react-component-lifecycle
None
None
None
None
None
None
None
UJNF &YBNQMFT
None
setDisplayName toClass lifecycle getContext withContext onlyUpdateForPropTypes onlyUpdateForKeys setStatic setPropTypes componentFromStream
setObservableConfig createEventHandlerWithConfig createEventHandler mapPropsStreamWithConfig mapPropsStream componentFromStreamWithConfig compose isClassComponent getDisplayName wrapDisplayName shallowEqual createSink componentFromProp nest hoistStatics mapProps withProps withHandlers withPropsOnChange renameProps defaultProps renameProp withState renderComponent renderNothing withReducer withStateHandlers shouldUpdate pure branch flattenProp
Any takeaways
Even if you are not directly contributing to libraries you
have still a lot to share
"XFTPNF 3FDPNQPTF
Make ideas clearly stand out in your examples, no matter
how complex they are
Useful Example Complex example Simple example
Even if something wasn’t clear from the first time there
is always another way
%KBOHP(JSMT,ZJW
None
Image source: https://hacks.mozilla.org/2017/11/entering-the-quantum-era-how-firefox-got-fast-again-and-where-its-going-to-get-faster/ -JO$MBSLXPSLT
Image source: https://twitter.com/kosamari/status/859958929484337152 $PEFEPPEMFTCZ.BSJLP,PTBLB
None
None
Code Example Input Output
None
None
Even if something wasn’t clear from the first time there
is always another way