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
Structuring a React.js App
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Mauricio Soares
April 02, 2016
Technology
300
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Structuring a React.js App
This talked was presented on the 7 masters event.
Mauricio Soares
April 02, 2016
More Decks by Mauricio Soares
See All by Mauricio Soares
Javascript para adultos
mauriciosoares
28
3.5k
Other Decks in Technology
See All in Technology
Execution in the Kingdom of Agents: Reflections on Abstraction and Complexity
bcantrill
0
900
Datadog の学び方 - あるいは、オブザーバビリティを学ぶとは何か
mananyuki
1
510
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
260
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
580
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
自作バイナリを動かす「入口」8選
puhitaku
1
1.2k
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
0
220
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
280
メルペイ 会計システム概要と歴史
mewuto
0
200
The seven pitfalls of AI (revised version)
ufried
0
310
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
6
5.5k
全人類(ほぼ)AWS Organizations の上でAWSを利用している、その世界を知る話
htan
1
130
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
730
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Deep Space Network (abreviated)
tonyrice
0
360
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
870
RailsConf 2023
tenderlove
30
1.6k
The Curse of the Amulet
leimatthew05
3
15k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
320
Faster Mobile Websites
deanohume
310
32k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
A designer walks into a library…
pauljervisheath
211
25k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Transcript
Structuring a React.js App
Mauricio Soares Software Developer @ Loggi @omauriciosoares gh/mauriciosoares
Default Pattern ʮʒʒ actions ʮʒʒ components ʮʒʒ containers ʮʒʒ index.js
ʦʒʒ reducers
Works very well for small projects But still there’s a
problem…
Too many components ʮʒʒ actions ʮʒʒ components ʔ ʦʒʒ …
30 files ʮʒʒ containers ʔ ʦʒʒ … 15 files ʮʒʒ index.js ʦʒʒ reducers
A Solution Not the silver bullet
ʮʒʒ actions ʮʒʒ index.js ʮʒʒ reducers ʮʒʒ screens ʦʒʒ shared
Actions and Reducers basically keeps the same
ʮʒʒ actions ʮʒʒ index.js ʮʒʒ reducers ʮʒʒ screens ʦʒʒ shared
shared is everything that can be used within your application (utils / components / routes / constants)
ʮʒʒ actions ʮʒʒ index.js ʮʒʒ reducers ʮʒʒ screens ʦʒʒ shared
Screens are components that have a great responsability on your application (usually containers)
None
None
ʦʒʒ screens ʮʒʒ header ʔ ʦʒʒ index.js ʮʒʒ map ʔ
ʦʒʒ index.js ʮʒʒ order ʔ ʦʒʒ index.js ʦʒʒ sidebar ʔ ʦʒʒ index.js
None
ʦʒʒ screens ʦʒʒ order ʦʒʒ screens ʮʒʒ form ʔ ʦʒʒ
index.js ʦʒʒ summary ʦʒʒ index.js Screens may have inner screens
ʦʒʒ screens ʦʒʒ order ʮʒʒ screens ʔ ʮʒʒ form ʔ
ʔ ʦʒʒ index.js ʔ ʦʒʒ summary ʔ ʦʒʒ index.js ʦʒʒ shared ʦʒʒ components ʦʒʒ select ʦʒʒ index.js Screens may have a shared folder
If a file is shared among other root screens, it
goes to the root shared folder
ʦʒʒ screens ʦʒʒ order ʦʒʒ shared ʦʒʒ components ʦʒʒ select
ʮʒʒ __tests__ ʦʒʒ index.js Tests files belongs to it’s context
ʦʒʒ screens ʦʒʒ order ʦʒʒ shared ʦʒʒ components ʦʒʒ select
ʮʒʒ __tests__ ʮʒʒ index.css ʦʒʒ index.js CSS files belongs to it’s context as well (thank God webpack!)
inner folders === path hell
import CoreComponent from '../../../../../../../shared/components/core-component'
web builders for the rescue! webpack: https://webpack.github.io/docs/configuration.html#resolve-modulesdirectories grunt: https://github.com/jmreidy/grunt-browserify#alias
import CoreComponent from 'shared/components/core-component';
Thanks!