![]() React was originally created for the DOM but it was later adapted to also support native platforms with React Native. The corresponding standalone browser build is called react.js, and it exports a global called React. It is available on npm as the react package. The code for React core is located in packages/react in the source tree. It is used both by React DOM and React Native components. It does not include the reconciliation algorithm or any platform-specific code. React core only includes the APIs necessary to define components. The “core” of React includes all the top-level React APIs, for example: Its repository contains multiple separate packages so that their changes can be coordinated together, and issues live in one place. You can run yarn flow locally to check your code with Flow. When possible, new code should use Flow annotations. detachRefs = function ( instance : ReactInstance, element : ReactElement | string | number | null | false, ) : void The React codebase uses console.error to display warnings: Instead, we put them into a directory called _tests_ relative to the files that they test.įor example, a test for setInnerHTML.js is located in _tests_/setInnerHTML-test.js right next to it. We don’t have a top-level directory for unit tests. There are a few other top-level folders but they are mostly used for the tooling and you likely won’t ever encounter them when contributing. The documentation is hosted in a separate repository from React. It is not in the repository but it will appear in your React clone after you build it for the first time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |