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
550
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
60
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
100
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
440
Other Decks in Programming
See All in Programming
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
560
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
100
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
230
Flow は今どうなっているか
mizdra
PRO
0
800
バグを直したら useEffect が消えた
colorful12
3
780
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
670
Cloudflare is Agents
chimame
0
190
ALB ログから Trace を気合で繋げる技術
fohte
7
820
ソフトウェアラスタライザ
fadis
1
750
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
120
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
480
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.1k
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
410
Game over? The fight for quality and originality in the time of robots
wayneb77
1
260
Designing for Timeless Needs
cassininazir
1
460
Un-Boring Meetings
codingconduct
0
400
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
310
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
220
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
460
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
480
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
710
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
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