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
430
Other Decks in Programming
See All in Programming
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
170
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
390
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.5k
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.6k
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
370
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
680
Google Apps Script で Ruby を動かす
kawahara
0
150
メールのエイリアス機能を履き違えない
isshinfunada
0
230
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
470
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
260
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
230
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
52k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
470
Typedesign – Prime Four
hannesfritz
42
3.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The Pragmatic Product Professional
lauravandoore
37
7.4k
エンジニアに許された特別な時間の終わり
watany
108
250k
The Language of Interfaces
destraynor
162
27k
Crafting Experiences
bethany
1
250
Done Done
chrislema
186
16k
Evolving SEO for Evolving Search Engines
ryanjones
0
250
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