Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add React JSX runtime to default exceptions for inline requires (#1126)
Summary: JSX runtime calls are all over the place in every components. When using inline requires, it doesn't make sense to go through the method call + array access + property access just to call the JSX factory. Pull Request resolved: #1126 Test Plan: Before (with inline requires on): ```js Object.defineProperty(exports, '__esModule', { value: true, }); var _reactNative = _$$_REQUIRE(_dependencyMap[0], "react-native"), View = _reactNative.View, Text = _reactNative.Text; function App() { return /*#__PURE__*/_$$_REQUIRE(_dependencyMap[1], "react/jsx-runtime").jsx(View, { style: { flex: 1, backgroundColor: 'green' }, children: /*#__PURE__*/_$$_REQUIRE(_dependencyMap[1], "react/jsx-runtime").jsxs(Text, { style: { flex: 1 }, children: ["whatever ", _$$_IMPORT_ALL(_dependencyMap[2], "./test").A] }) }); } ``` After (with inline requires on): ```js Object.defineProperty(exports, '__esModule', { value: true, lol: true }); var _reactNative = _$$_REQUIRE(_dependencyMap[0], "react-native"), View = _reactNative.View, Text = _reactNative.Text; var _jsxs = _$$_REQUIRE(_dependencyMap[1], "react/jsx-runtime").jsxs; var _jsx = _$$_REQUIRE(_dependencyMap[1], "react/jsx-runtime").jsx; function App() { return /*#__PURE__*/_jsx(View, { style: { flex: 1, backgroundColor: 'green' }, children: /*#__PURE__*/_jsxs(Text, { style: { flex: 1 }, children: ["whatever ", _$$_IMPORT_ALL(_dependencyMap[2], "./test").A] }) }); } ``` I added both `react/jsx-runtime` and `react/jsx-dev-runtime` even though currently RN only uses the former. Reviewed By: motiz88 Differential Revision: D50807788 Pulled By: robhogan fbshipit-source-id: 7ca9b9fd1b63a7726bd1a60d32815586e54fa7fd
- Loading branch information