You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removed deadlink from Event System section and added correct links (reactjs#3136)
* Removed deadlink from Event System section and added correct links
* Changed wording of Event System section and removed react-native events link
* Update codebase-overview.md
Co-authored-by: Dowen Robinson <[email protected]>
Co-authored-by: Dan Abramov <[email protected]>
When possible, new code should use Flow annotations.
115
93
You can run `yarn flow` locally to check your code with Flow.
116
94
117
-
### Dynamic Injection {#dynamic-injection}
118
-
119
-
React uses dynamic injection in some modules. While it is always explicit, it is still unfortunate because it hinders understanding of the code. The main reason it exists is because React originally only supported DOM as a target. React Native started as a React fork. We had to add dynamic injection to let React Native override some behaviors.
120
-
121
-
You may see modules declaring their dynamic dependencies like this:
The `injection` field is not handled specially in any way. But by convention, it means that this module wants to have some (presumably platform-specific) dependencies injected into it at runtime.
147
-
148
-
There are multiple injection points in the codebase. In the future, we intend to get rid of the dynamic injection mechanism and wire up all the pieces statically during the build.
149
-
150
95
### Multiple Packages {#multiple-packages}
151
96
152
97
React is a [monorepo](https://danluu.com/monorepo/). Its repository contains multiple separate packages so that their changes can be coordinated together, and issues live in one place.
@@ -211,9 +156,7 @@ Its source code is located in [`packages/react-reconciler`](https://github.com/f
211
156
212
157
### Event System {#event-system}
213
158
214
-
React implements a synthetic event system which is agnostic of the renderers and works both with React DOM and React Native. Its source code is located in [`packages/legacy-events`](https://github.com/facebook/react/tree/master/packages/legacy-events).
215
-
216
-
There is a [video with a deep code dive into it](https://www.youtube.com/watch?v=dRo_egw7tBc) (66 mins).
159
+
React implements a layer over native events to smooth out cross-browser differences. Its source code is located in [`packages/react-dom/src/events`](https://github.com/facebook/react/tree/master/packages/react-dom/src/events).
0 commit comments