Removed deadlink from Event System section and added correct links (#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 <drobinson@ad.accelclaims.com>
Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
When possible, new code should use Flow annotations.
You can run `yarn flow` locally to check your code with Flow.
### Dynamic Injection {#dynamic-injection}
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.
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.
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.
### Multiple Packages {#multiple-packages}
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
### Event System {#event-system}
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).
There is a [video with a deep code dive into it](https://www.youtube.com/watch?v=dRo_egw7tBc) (66 mins).
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).