Skip to content

Commit cf40314

Browse files
committed
Shorten comments in webUtils.web.ts
1 parent ab0c2ff commit cf40314

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

  • packages/react-native-reanimated/src/ReanimatedModule/js-reanimated

packages/react-native-reanimated/src/ReanimatedModule/js-reanimated/webUtils.web.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
'use strict';
22

33
// react-native-web exposes these style helpers only through internal modules.
4-
// They're imported statically so strict-ESM bundlers (webpack, Rollup, esbuild)
5-
// and SSR resolve them at build time and they're always defined synchronously - a
6-
// runtime require() isn't available in ESM there, which left them undefined and
7-
// crashed _updatePropsJS (#9844). The dist/cjs build (with explicit .js extensions)
8-
// is used because SSR frameworks load an externalized react-native-web with Node's
9-
// ESM resolver, which rejects the extensionless relative imports in dist/exports.
4+
// The dist/cjs build (with .js extensions) resolves under Metro, strict-ESM
5+
// bundlers and Node's ESM resolver (SSR); a runtime require() would not (#9844).
106
// eslint-disable-next-line n/no-unpublished-import
117
import * as createReactDOMStyleModule from 'react-native-web/dist/cjs/exports/StyleSheet/compiler/createReactDOMStyle.js';
128
// eslint-disable-next-line n/no-unpublished-import
139
import * as preprocessModule from 'react-native-web/dist/cjs/exports/StyleSheet/preprocess.js';
1410

15-
// createReactDOMStyle is a CJS default export (module.exports = fn), so unwrap
16-
// `.default`. createTransformValue / createTextShadowValue are named exports on
17-
// module.exports and are read directly - they're not on `.default`, which is a
18-
// separate `preprocess` function.
11+
// createReactDOMStyle is `module.exports = fn` (unwrap `.default`); the preprocess
12+
// helpers are named exports read directly (not on `.default`, a separate fn).
1913
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2014
const interopDefault = (moduleExports: any) =>
2115
moduleExports?.default ?? moduleExports;

0 commit comments

Comments
 (0)