diff --git a/.flowconfig b/.flowconfig index d6100d13..5163ecc2 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,5 +1,5 @@ [version] -0.270.0 +0.307.1 [ignore] .*/malformed_package_json/.* @@ -7,6 +7,9 @@ [include] +[declarations] +.*/node_modules/.* + [options] casting_syntax=as component_syntax=true @@ -14,8 +17,6 @@ module.name_mapper='^react-strict-dom$' -> '/packages/react-strict module.system.node.resolve_dirname=flow_modules module.system.node.resolve_dirname=node_modules react.runtime=automatic -suppress_type=$FlowIssue -suppress_type=$FlowFixMe [strict] nonstrict-import diff --git a/apps/platform-tests/src/components/App.js b/apps/platform-tests/src/components/App.js index 605380eb..7a7abab3 100644 --- a/apps/platform-tests/src/components/App.js +++ b/apps/platform-tests/src/components/App.js @@ -71,24 +71,30 @@ const themedStyles = css.create({ function ThemeExample() { return ( + // $FlowFixMe[incompatible-type] {/* default theme */} + {/* $FlowFixMe[incompatible-type] */} {/* redblue theme */} + {/* $FlowFixMe[incompatible-type] */} {/* purpleyellow theme */} + {/* $FlowFixMe[incompatible-type] */} {/* greenpink theme */} + {/* $FlowFixMe[incompatible-type] */} {/* nested theme */} + {/* $FlowFixMe[incompatible-type] */} @@ -152,6 +158,7 @@ function Shell(): React.MixedElement { dfadsafdsfadsf inside div (kind of) works span inside div inside span... + {/* $FlowFixMe[incompatible-type] */} works @@ -212,6 +219,7 @@ function Shell(): React.MixedElement { console.log(e.type, e); }} src="http://placehold.jp/150x150.png" + // $FlowFixMe[incompatible-type] style={styles.objContain} width={150} /> @@ -290,8 +298,11 @@ function Shell(): React.MixedElement { {/* flex row undoes block layout emulation and correct flex child layout */} display:flex defaults and children + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} Back to block @@ -303,6 +314,7 @@ function Shell(): React.MixedElement { display:block resets flex properties {/* display block undoes row layout and emulates block again */} + {/* $FlowFixMe[incompatible-type] */} @@ -328,19 +340,26 @@ function Shell(): React.MixedElement { {/* logical styles emulation */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} {/* CSS positioning (static by default) */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} @@ -348,11 +367,13 @@ function Shell(): React.MixedElement { {/* CSS text */} + {/* $FlowFixMe[incompatible-type] */} test (unitless) + {/* $FlowFixMe[incompatible-type] */} test (em) @@ -462,6 +483,7 @@ function Shell(): React.MixedElement { Transform + Opacity + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} @@ -491,7 +517,7 @@ function Shell(): React.MixedElement { @@ -511,7 +537,7 @@ function Shell(): React.MixedElement { @@ -523,7 +549,7 @@ function Shell(): React.MixedElement { @@ -535,6 +561,7 @@ function Shell(): React.MixedElement { {/* hover */} + {/* $FlowFixMe[incompatible-type] */} @@ -581,7 +608,9 @@ function Shell(): React.MixedElement { style={[styles.h100, styles.dynamicBg(clickData.color)]} > {clickData.text} + {/* $FlowFixMe[incompatible-type] */} + {/* $FlowFixMe[incompatible-type] */} @@ -604,6 +633,7 @@ function Shell(): React.MixedElement { + {/* $FlowFixMe[incompatible-type] */} button: {clickEventData.button} @@ -624,6 +654,7 @@ function Shell(): React.MixedElement { setImageLoadText(`${e.type}: loaded`); }} src="http://placehold.jp/150x150.png" + // $FlowFixMe[incompatible-type] style={styles.objContain} width={150} /> @@ -634,6 +665,7 @@ function Shell(): React.MixedElement { setImageErrorText(`${e.type}: errored`); }} src="http://error" + // $FlowFixMe[incompatible-type] style={styles.objContain} width={150} /> diff --git a/flow-typed/environments/bom.js b/flow-typed/environments/bom.js index 2c7c3cb0..86f75446 100644 --- a/flow-typed/environments/bom.js +++ b/flow-typed/environments/bom.js @@ -826,6 +826,7 @@ declare class SharedWorker extends EventTarget { declare function importScripts(...urls: Array): void; declare class WorkerGlobalScope extends EventTarget { + // $FlowFixMe[incompatible-variance] self: this; location: WorkerLocation; navigator: WorkerNavigator; diff --git a/flow-typed/environments/dom.js b/flow-typed/environments/dom.js index 2cf16042..ad89ae53 100644 --- a/flow-typed/environments/dom.js +++ b/flow-typed/environments/dom.js @@ -966,6 +966,7 @@ declare class HTMLCollection<+Elem: Element> { length: number; item(nameOrIndex?: any, optionalIndex?: any): Elem | null; namedItem(name: string): Elem | null; + // $FlowFixMe[incompatible-variance] [index: number | string]: Elem; } diff --git a/flow-typed/environments/jsx.js b/flow-typed/environments/jsx.js index 81aa71cb..11ba0f2c 100644 --- a/flow-typed/environments/jsx.js +++ b/flow-typed/environments/jsx.js @@ -27,6 +27,7 @@ declare class SyntheticEvent<+T: EventTarget = EventTarget, +E: Event = Event> { isDefaultPrevented(): boolean; isPropagationStopped(): boolean; isTrusted: boolean; + // $FlowFixMe[incompatible-variance] nativeEvent: E; persist(): void; preventDefault(): void; diff --git a/flow-typed/environments/node.js b/flow-typed/environments/node.js index 99e36654..646c92ae 100644 --- a/flow-typed/environments/node.js +++ b/flow-typed/environments/node.js @@ -1566,6 +1566,7 @@ type http$agentOptions = { declare class http$Agent<+SocketT = net$Socket> { constructor(options: http$agentOptions): void; destroy(): void; + // $FlowFixMe[incompatible-variance] freeSockets: { [name: string]: $ReadOnlyArray, ... }; getName(options: { host: string, @@ -1575,7 +1576,9 @@ declare class http$Agent<+SocketT = net$Socket> { }): string; maxFreeSockets: number; maxSockets: number; + // $FlowFixMe[incompatible-variance] requests: { [name: string]: $ReadOnlyArray>, ... }; + // $FlowFixMe[incompatible-variance] sockets: { [name: string]: $ReadOnlyArray, ... }; } diff --git a/package-lock.json b/package-lock.json index 066533fe..9b61b131 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "eslint-plugin-react": "^7.33.1", "eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613", "flow-api-translator": "^0.32.1", - "flow-bin": "^0.270.0", + "flow-bin": "^0.307.1", "glob": "^11.1.0", "hermes-eslint": "^0.32.0", "husky": "^8.0.0", @@ -393,7 +393,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -581,7 +580,6 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz", "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -827,7 +825,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "peer": true, "engines": { "node": ">=12" }, @@ -839,7 +836,6 @@ "version": "19.2.1", "resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz", "integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -881,7 +877,6 @@ "version": "7.2.6", "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.6.tgz", "integrity": "sha512-tI2l/nFHC5rLh7+5+o7QjKjSR04ivXDF4jcgV0f/bTQ+OJiITy5S6gaynVsEM+7RqzufMnVbIon6Sr5x1SDYaQ==", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -1127,7 +1122,6 @@ "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.29.0.tgz", "integrity": "sha512-cZ0Iq3OzFUPpgszzDr1G1aJV5UMIZ4VygJ2Az252q4Rdf5cQMhYEIKArWY/oUjMhQmosM8ygOovNq7gvA9CdCg==", "license": "MIT", - "peer": true, "dependencies": { "@algolia/client-common": "5.29.0", "@algolia/requester-browser-xhr": "5.29.0", @@ -1304,7 +1298,6 @@ "version": "7.28.5", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -3512,7 +3505,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -3535,7 +3527,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -3616,7 +3607,6 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", - "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -3980,7 +3970,6 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", - "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -4981,7 +4970,6 @@ "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.8.1.tgz", "integrity": "sha512-oByRkSZzeGNQByCMaX+kif5Nl2vmtj2IHQI2fWjCfCootsdKZDPFLonhIp5s3IGJO7PLUfe0POyw0Xh/RrGXJA==", "license": "MIT", - "peer": true, "dependencies": { "@docusaurus/core": "3.8.1", "@docusaurus/logger": "3.8.1", @@ -8325,7 +8313,6 @@ "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.0.tgz", "integrity": "sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==", "license": "MIT", - "peer": true, "dependencies": { "@types/mdx": "^2.0.0" }, @@ -9636,7 +9623,6 @@ "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.21.3", "@svgr/babel-preset": "8.1.0", @@ -9786,6 +9772,7 @@ "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -9806,6 +9793,7 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -9819,6 +9807,7 @@ "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -9833,7 +9822,8 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@testing-library/react": { "version": "16.3.0", @@ -9898,14 +9888,14 @@ "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -10252,7 +10242,6 @@ "version": "19.2.7", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -11458,7 +11447,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -11542,7 +11530,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -11607,7 +11594,6 @@ "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.29.0.tgz", "integrity": "sha512-E2l6AlTWGznM2e7vEE6T6hzObvEyXukxMOlBmVlMyixZyK1umuO/CiVc6sDBbzVH0oEviCE5IfVY1oZBmccYPQ==", "license": "MIT", - "peer": true, "dependencies": { "@algolia/client-abtesting": "5.29.0", "@algolia/client-analytics": "5.29.0", @@ -11780,6 +11766,7 @@ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "dequal": "^2.0.3" } @@ -12801,7 +12788,6 @@ "url": "https://github.com/sponsors/ai" } ], - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -14198,7 +14184,6 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", - "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -15248,7 +15233,8 @@ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/dom-converter": { "version": "0.2.0", @@ -15861,7 +15847,6 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -15976,7 +15961,6 @@ "integrity": "sha512-VGMpFQGUQWYT9LfnPcX8ouFojyrZ/2w3K5BucvxL/spdNehccKhB4jUyB1yBCXpr2XFm0jkECxgrpXBW2ipoAw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.44.0", "@typescript-eslint/types": "8.44.0", @@ -16269,7 +16253,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -16961,7 +16944,6 @@ "resolved": "https://registry.npmjs.org/expo/-/expo-53.0.22.tgz", "integrity": "sha512-sJ2I4W/e5iiM4u/wYCe3qmW4D7WPCRqByPDD0hJcdYNdjc9HFFFdO4OAudZVyC/MmtoWZEIH5kTJP1cw9FjzYA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "0.24.21", @@ -17100,7 +17082,6 @@ "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-13.3.2.tgz", "integrity": "sha512-wUlMdpqURmQ/CNKK/+BIHkDA5nGjMqNlYmW0pJFXY/KE/OG80Qcavdu2sHsL4efAIiNGvYdBS10WztuQYU4X0A==", "license": "MIT", - "peer": true, "dependencies": { "fontfaceobserver": "^2.1.0" }, @@ -17882,9 +17863,9 @@ } }, "node_modules/flow-bin": { - "version": "0.270.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.270.0.tgz", - "integrity": "sha512-luYf2Sv5zD7xJkAgU59UbBhfb3mCVhqLK5qZgLg6NN2QIj0pJp9H3OplRbrD+zts7MA+vPIlP83ktYhm57IhRA==", + "version": "0.307.1", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.307.1.tgz", + "integrity": "sha512-0AglecFYaFu5ooF1IJmm4SBUZO7sopMU0jTr/Bburm/XxkJUtql+MDpwqKBFe1DTd2I/3kBzqOIFgwsZ8gS7tw==", "dev": true, "license": "MIT", "bin": { @@ -19085,7 +19066,6 @@ "integrity": "sha512-3ljktN2ek+bRRsPAcMeqMEJou6s2MRe6VuLkLsXDXuVrJfRZ7V2VUw41T9uAt9lcA2xaJP4yykYAnMg15nsRPw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esrecurse": "^4.3.0", "hermes-estree": "0.32.1", @@ -22740,6 +22720,7 @@ "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "lz-string": "bin/bin.js" } @@ -27433,7 +27414,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -28349,7 +28329,6 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", - "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -28902,7 +28881,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.0.tgz", "integrity": "sha512-ujSB9uXHJKzM/2GBuE0hBOUgC77CN3Bnpqa+g80bkv3T3A93wL/xlzDATHhnhkzifz/UE2SNOvmbTz5hSkDlHw==", "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -28919,7 +28897,6 @@ "integrity": "sha512-B5vzcDyTA/T0R7LGMSkLTp3VtRCEe1NItzsM6L/4gDOBGzDDMMMOwxRxogwL9xL07GPBOJrzlggwFaSQOhLVLw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "hermes-estree": "0.25.0", "hermes-parser": "0.25.0", @@ -29325,7 +29302,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -29366,7 +29342,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.25.0" }, @@ -29428,7 +29403,6 @@ "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-6.0.0.tgz", "integrity": "sha512-YMMxTUQV/QFSnbgrP3tjDzLHRg7vsbMn8e9HAa8o/1iXoiomo48b7sk/kkmWEuWNDPJVlKSJRB6Y2fHqdJk+SQ==", "license": "MIT", - "peer": true, "dependencies": { "@types/react": "*" }, @@ -29457,7 +29431,6 @@ "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.79.5.tgz", "integrity": "sha512-jVihwsE4mWEHZ9HkO1J2eUZSwHyDByZOqthwnGrVZCh6kTQBCm4v8dicsyDa6p0fpWNE5KicTcpX/XXl0ASJFg==", "license": "MIT", - "peer": true, "dependencies": { "@jest/create-cache-key-function": "^29.7.0", "@react-native/assets-registry": "0.79.5", @@ -29689,7 +29662,6 @@ "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", @@ -31110,7 +31082,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -33099,7 +33070,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -33519,7 +33489,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -33585,7 +33554,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.48.1.tgz", "integrity": "sha512-PC0PDZfJg8sP7cmKe6L3QIL8GZwU5aRvUFedqSIpw3B+QjRSUZeeITC2M5XKeMXEzL6wccN196iy3JLwKNvDVA==", "dev": true, - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.48.1", "@typescript-eslint/types": "8.48.1", @@ -34551,7 +34519,6 @@ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.9.tgz", "integrity": "sha512-brOPwM3JnmOa+7kd3NsmOUOwbDAj8FT9xDsG3IW0MgbN9yZV7Oi/s/+MNQ/EcSMqw7qfoRyXPoeEWT8zLVdVGg==", "license": "MIT", - "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", @@ -35391,7 +35358,6 @@ "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", "devOptional": true, "license": "ISC", - "peer": true, "engines": { "node": ">= 14" } @@ -35480,7 +35446,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 4646631f..18146d8e 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "eslint-plugin-react": "^7.33.1", "eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613", "flow-api-translator": "^0.32.1", - "flow-bin": "^0.270.0", + "flow-bin": "^0.307.1", "glob": "^11.1.0", "hermes-eslint": "^0.32.0", "husky": "^8.0.0", diff --git a/packages/react-strict-animated/src/native/components.js b/packages/react-strict-animated/src/native/components.js index 03ef1f2d..5be2d99b 100644 --- a/packages/react-strict-animated/src/native/components.js +++ b/packages/react-strict-animated/src/native/components.js @@ -82,20 +82,22 @@ export component AnimatedDiv( animatedStyle?: AnimatedStyleValue, children?: React.Node, ref?: React.RefSetter>, - ...htmlProps: Omit, 'children'> + ...htmlProps: Omit, 'children' | 'ref'> ) { const scaledAnimatedStyle = useViewportScaledAnimatedStyle(animatedStyle); return ( - // $FlowFixMe[prop-missing] - RSD missing ref type on compat.native API + // $FlowFixMe[incompatible-type] {(nativeProps: React.PropsOf) => { return ( + // $FlowFixMe[invalid-component-prop] , children?: React.Node, ref?: React.RefSetter>, - ...htmlProps: Omit, 'children'> + ...htmlProps: Omit, 'children' | 'ref'> ) { const scaledAnimatedStyle = useViewportScaledAnimatedStyle(animatedStyle); return ( - // $FlowFixMe[prop-missing] - RSD missing ref type on compat.native API + // $FlowFixMe[incompatible-type] {(nativeProps: React.PropsOf) => { return ( + // $FlowFixMe[incompatible-type] + // $FlowFixMe[invalid-component-prop] , ref?: React.RefSetter>, - ...htmlProps: React.PropsOf + ...htmlProps: Omit, 'ref'> ) { const scaledAnimatedStyle = useViewportScaledAnimatedStyle(animatedStyle); return ( - // $FlowFixMe[prop-missing] - RSD missing ref type on compat.native API + // $FlowFixMe[incompatible-type] {(nativeProps: ImageProps) => { diff --git a/packages/react-strict-animated/src/web/Animation.js b/packages/react-strict-animated/src/web/Animation.js index bfb589ff..6c935621 100644 --- a/packages/react-strict-animated/src/web/Animation.js +++ b/packages/react-strict-animated/src/web/Animation.js @@ -73,7 +73,7 @@ export function interpolate( config: InterpolationConfig ): AnimatedNodeType { return Interpolate( - // $FlowFixMe[incompatible-cast] - need a sketchy cast to be compatible with RN version of Animated + // $FlowFixMe[incompatible-type] - need a sketchy cast to be compatible with RN version of Animated value as AnimatedWithChildren, config ); diff --git a/packages/react-strict-animated/src/web/components.js b/packages/react-strict-animated/src/web/components.js index c99106e2..26678d66 100644 --- a/packages/react-strict-animated/src/web/components.js +++ b/packages/react-strict-animated/src/web/components.js @@ -25,7 +25,7 @@ export component AnimatedDiv( animatedStyle?: AnimatedStyleValue, ref?: React.RefSetter>, style as incomingStyle?: React.PropsOf['style'], - ...restProps: Omit, 'style'> + ...restProps: Omit, 'style' | 'ref'> ) { const [{ opacity, transform }, animatedRefSetter] = useAnimatedStyle(animatedStyle, ref); @@ -46,7 +46,7 @@ export component AnimatedSpan( animatedStyle?: AnimatedStyleValue, ref?: React.RefSetter>, style as incomingStyle?: React.PropsOf['style'], - ...restProps: Omit, 'style'> + ...restProps: Omit, 'style' | 'ref'> ) { const [{ opacity, transform }, animatedRefSetter] = useAnimatedStyle(animatedStyle, ref); @@ -67,7 +67,7 @@ export component AnimatedImg( animatedStyle?: AnimatedStyleValue, ref?: React.RefSetter>, style as incomingStyle?: React.PropsOf['style'], - ...restProps: Omit, 'style'> + ...restProps: Omit, 'style' | 'ref'> ) { const [{ opacity, transform }, animatedRefSetter] = useAnimatedStyle(animatedStyle, ref); diff --git a/packages/react-strict-dom/src/native/html.js b/packages/react-strict-dom/src/native/html.js index 048e26a0..4773d430 100644 --- a/packages/react-strict-dom/src/native/html.js +++ b/packages/react-strict-dom/src/native/html.js @@ -97,7 +97,9 @@ const headingProps = { export const a: component( ref?: React.RefSetter, ...StrictReactDOMAnchorProps -) = createStrictText('a', { style: [styles.defaults, styles.a] }) as $FlowFixMe; +) = createStrictText('a', { + style: [styles.defaults, styles.a] +} as $FlowFixMe) as $FlowFixMe; /** * "article" (block) @@ -105,7 +107,9 @@ export const a: component( export const article: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('article', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('article', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "aside" (block) @@ -113,7 +117,9 @@ export const article: component( export const aside: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('aside', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('aside', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "b" (inline) @@ -123,7 +129,7 @@ export const b: component( ...StrictReactDOMProps ) = createStrictText('b', { style: [styles.defaults, styles.bold] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "bdi" (inline) @@ -131,7 +137,9 @@ export const b: component( export const bdi: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('bdi', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('bdi', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "bdo" (inline) @@ -139,7 +147,9 @@ export const bdi: component( export const bdo: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('bdo', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('bdo', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "blockquote" (block) @@ -147,7 +157,9 @@ export const bdo: component( export const blockquote: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('blockquote', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('blockquote', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "br" @@ -166,7 +178,7 @@ export const button: component( ) = createStrict('button', { style: [styles.defaults, styles.button], type: 'button' -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "code" (inline) @@ -176,7 +188,7 @@ export const code: component( ...StrictReactDOMProps ) = createStrictText('code', { style: [styles.defaults, styles.code] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "del" (inline) @@ -186,7 +198,7 @@ export const del: component( ...StrictReactDOMProps ) = createStrictText('del', { style: [styles.defaults, styles.lineThrough] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "div" (block) @@ -194,7 +206,7 @@ export const del: component( export const div: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('div', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('div', { style: styles.defaults } as $FlowFixMe) as $FlowFixMe; /** * "em" (inline) @@ -204,7 +216,7 @@ export const em: component( ...StrictReactDOMProps ) = createStrictText('em', { style: [styles.defaults, styles.italic] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "fieldset" (block) @@ -212,7 +224,9 @@ export const em: component( export const fieldset: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('fieldset', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('fieldset', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "footer" (block) @@ -220,7 +234,9 @@ export const fieldset: component( export const footer: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('footer', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('footer', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "form" (block) @@ -228,7 +244,9 @@ export const footer: component( export const form: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('form', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('form', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "h1-h6" (block) @@ -236,27 +254,27 @@ export const form: component( export const h1: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('h1', headingProps) as $FlowFixMe; +) = createStrictText('h1', headingProps as $FlowFixMe) as $FlowFixMe; export const h2: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('h2', headingProps) as $FlowFixMe; +) = createStrictText('h2', headingProps as $FlowFixMe) as $FlowFixMe; export const h3: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('h3', headingProps) as $FlowFixMe; +) = createStrictText('h3', headingProps as $FlowFixMe) as $FlowFixMe; export const h4: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('h4', headingProps) as $FlowFixMe; +) = createStrictText('h4', headingProps as $FlowFixMe) as $FlowFixMe; export const h5: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('h5', headingProps) as $FlowFixMe; +) = createStrictText('h5', headingProps as $FlowFixMe) as $FlowFixMe; export const h6: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('h6', headingProps) as $FlowFixMe; +) = createStrictText('h6', headingProps as $FlowFixMe) as $FlowFixMe; /** * "header" (block) @@ -264,7 +282,9 @@ export const h6: component( export const header: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('header', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('header', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "hr" (block) @@ -272,7 +292,9 @@ export const header: component( export const hr: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('hr', { style: [styles.defaults, styles.hr] }) as $FlowFixMe; +) = createStrict('hr', { + style: [styles.defaults, styles.hr] +} as $FlowFixMe) as $FlowFixMe; /** * "i" (inline) @@ -282,7 +304,7 @@ export const i: component( ...StrictReactDOMProps ) = createStrictText('i', { style: [styles.defaults, styles.italic] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "img" (inline) @@ -292,7 +314,7 @@ export const img: component( ...StrictReactDOMImageProps ) = createStrictImage('img', { style: [styles.defaults, styles.img] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "input" (inline-block) @@ -302,7 +324,7 @@ export const input: component( ...StrictReactDOMInputProps ) = createStrictTextInput('input', { style: [styles.defaults, styles.input] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "ins" (inline) @@ -312,7 +334,7 @@ export const ins: component( ...StrictReactDOMProps ) = createStrictText('ins', { style: [styles.defaults, styles.underline] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "kbd" (inline) @@ -322,7 +344,7 @@ export const kbd: component( ...StrictReactDOMProps ) = createStrictText('kbd', { style: [styles.defaults, styles.code] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "label" (inline) @@ -330,7 +352,9 @@ export const kbd: component( export const label: component( ref?: React.RefSetter, ...StrictReactDOMLabelProps -) = createStrictText('label', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('label', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "li" (block) @@ -338,7 +362,7 @@ export const label: component( export const li: component( ref?: React.RefSetter, ...StrictReactDOMListItemProps -) = createStrict('li', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('li', { style: styles.defaults } as $FlowFixMe) as $FlowFixMe; /** * "main" (block) @@ -346,7 +370,9 @@ export const li: component( export const main: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('main', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('main', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "mark" (inline) @@ -356,7 +382,7 @@ export const mark: component( ...StrictReactDOMProps ) = createStrictText('mark', { style: [styles.defaults, styles.mark] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "nav" (block) @@ -364,7 +390,7 @@ export const mark: component( export const nav: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('nav', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('nav', { style: styles.defaults } as $FlowFixMe) as $FlowFixMe; /** * "ol" (block) @@ -372,7 +398,7 @@ export const nav: component( export const ol: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('ol', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('ol', { style: styles.defaults } as $FlowFixMe) as $FlowFixMe; /** * "optgroup" (block) @@ -380,7 +406,9 @@ export const ol: component( export const optgroup: component( ref?: React.RefSetter, ...StrictReactDOMOptionGroupProps -) = createStrict('optgroup', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('optgroup', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "option" @@ -388,7 +416,9 @@ export const optgroup: component( export const option: component( ref?: React.RefSetter, ...StrictReactDOMOptionProps -) = createStrictText('option', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('option', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "p" (block) @@ -396,7 +426,9 @@ export const option: component( export const p: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('p', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('p', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "pre" (block) @@ -406,7 +438,7 @@ export const pre: component( ...StrictReactDOMProps ) = createStrictText('pre', { style: [styles.defaults, styles.code] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "s" (inline) @@ -416,7 +448,7 @@ export const s: component( ...StrictReactDOMProps ) = createStrictText('s', { style: [styles.defaults, styles.lineThrough] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "section" (block) @@ -424,7 +456,9 @@ export const s: component( export const section: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('section', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('section', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "select" (inline-block) @@ -432,7 +466,9 @@ export const section: component( export const select: component( ref?: React.RefSetter, ...StrictReactDOMSelectProps -) = createStrict('select', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('select', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "span" (inline) @@ -440,7 +476,9 @@ export const select: component( export const span: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('span', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('span', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "strong" (inline) @@ -450,7 +488,7 @@ export const strong: component( ...StrictReactDOMProps ) = createStrictText('strong', { style: [styles.defaults, styles.bold] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "sub" (inline) @@ -458,7 +496,9 @@ export const strong: component( export const sub: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('sub', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('sub', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "sup" (inline) @@ -466,7 +506,9 @@ export const sub: component( export const sup: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrictText('sup', { style: styles.defaults }) as $FlowFixMe; +) = createStrictText('sup', { + style: styles.defaults +} as $FlowFixMe) as $FlowFixMe; /** * "textarea" (inline-block) @@ -476,7 +518,7 @@ export const textarea: component( ...StrictReactDOMTextAreaProps ) = createStrictTextInput('textarea', { style: [styles.defaults, styles.textarea] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "u" (inline) @@ -486,7 +528,7 @@ export const u: component( ...StrictReactDOMProps ) = createStrictText('u', { style: [styles.defaults, styles.underline] -}) as $FlowFixMe; +} as $FlowFixMe) as $FlowFixMe; /** * "ul" (block) @@ -494,4 +536,4 @@ export const u: component( export const ul: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('ul', { style: styles.defaults }) as $FlowFixMe; +) = createStrict('ul', { style: styles.defaults } as $FlowFixMe) as $FlowFixMe; diff --git a/packages/react-strict-dom/src/native/modules/TextString.js b/packages/react-strict-dom/src/native/modules/TextString.js index 997a65af..85589472 100644 --- a/packages/react-strict-dom/src/native/modules/TextString.js +++ b/packages/react-strict-dom/src/native/modules/TextString.js @@ -32,7 +32,7 @@ export function TextString(props: Props): React.Node { }); return ( - // $FlowFixMe + // $FlowFixMe[incompatible-type] ); } diff --git a/packages/react-strict-dom/src/native/modules/createStrictDOMComponent.js b/packages/react-strict-dom/src/native/modules/createStrictDOMComponent.js index eff82a1b..ebd16461 100644 --- a/packages/react-strict-dom/src/native/modules/createStrictDOMComponent.js +++ b/packages/react-strict-dom/src/native/modules/createStrictDOMComponent.js @@ -27,8 +27,10 @@ type StrictProps = $ReadOnly<{ }>; const AnimatedPressable = ReactNative.Animated.createAnimatedComponent< + // $FlowFixMe[invalid-component-prop] React.ElementConfig, typeof ReactNative.Pressable + // $FlowFixMe[incompatible-type] >(ReactNative.Pressable); export function createStrictDOMComponent( @@ -36,10 +38,15 @@ export function createStrictDOMComponent( defaultProps?: P ): component(ref?: React.RefSetter, ...P) { const provideInheritableStyle = + // $FlowFixMe[invalid-compare] tagName !== 'br' || tagName !== 'hr' || tagName !== 'option'; component Component(ref: React.RefSetter, ...props: P) { - let NativeComponent = + let NativeComponent: + | typeof ReactNative.Pressable + | typeof ReactNative.ViewNativeComponent + | typeof ReactNative.Animated.View + | typeof AnimatedPressable = tagName === 'button' ? ReactNative.Pressable : ReactNative.ViewNativeComponent; @@ -70,12 +77,16 @@ export function createStrictDOMComponent( // Tag-specific props if (tagName === 'button') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role ??= 'button'; } else if (tagName === 'header') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role ??= 'header'; } else if (tagName === 'li') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role ??= 'listitem'; } else if (tagName === 'ol' || tagName === 'ul') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role ??= 'list'; } @@ -83,22 +94,26 @@ export function createStrictDOMComponent( if (NativeComponent === ReactNative.Pressable) { if (props.disabled === true) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.disabled = true; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.focusable = false; } } + // $FlowFixMe[react-rule-hook-mutation] nativeProps.ref = elementRef; // Workaround: React Native doesn't support raw text children of View // Sometimes we can auto-fix this if (typeof nativeProps.children === 'string') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.children = ; } // Polyfill for default of "display:block" // which implies "displayInside:flow" - let nextDisplayInsideValue = 'flow'; + let nextDisplayInsideValue: 'flow' | 'flex' = 'flow'; const displayInsideValue = useDisplayInside(); const displayValue = nativeProps.style.display; @@ -126,27 +141,42 @@ export function createStrictDOMComponent( if (displayValue === 'flex') { nextDisplayInsideValue = 'flex'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.alignContent ??= 'stretch'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.alignItems ??= 'stretch'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexBasis ??= 'auto'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexDirection ??= 'row'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexShrink ??= 1; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexWrap ??= 'nowrap'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.justifyContent ??= 'flex-start'; } else if (displayValue === 'block' && displayInsideValue === 'flow') { // Force the block emulation styles nextDisplayInsideValue = 'flow'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.alignItems = 'stretch'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.display = 'flex'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexBasis = 'auto'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexDirection = 'column'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexShrink = 0; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexWrap = 'nowrap'; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.justifyContent = 'flex-start'; } if (displayInsideValue === 'flex') { // flex child should not shrink by default + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.flexShrink ??= 1; } @@ -168,7 +198,7 @@ export function createStrictDOMComponent( typeof props.children === 'function' ? ( props.children(nativeProps) ) : ( - // $FlowFixMe + // $FlowFixMe[incompatible-type] ); diff --git a/packages/react-strict-dom/src/native/modules/createStrictDOMImageComponent.js b/packages/react-strict-dom/src/native/modules/createStrictDOMImageComponent.js index 52a4be12..4f3c0e0a 100644 --- a/packages/react-strict-dom/src/native/modules/createStrictDOMImageComponent.js +++ b/packages/react-strict-dom/src/native/modules/createStrictDOMImageComponent.js @@ -21,7 +21,9 @@ export function createStrictDOMImageComponent( _defaultProps?: P ): component(ref?: React.RefSetter, ...P) { component Component(ref: React.RefSetter, ...props: P) { - let NativeComponent = ReactNative.Image; + let NativeComponent: + | typeof ReactNative.Image + | typeof ReactNative.Animated.Image = ReactNative.Image; const elementRef = useStrictDOMElement(ref, { tagName }); const { @@ -56,15 +58,19 @@ export function createStrictDOMImageComponent( // Tag-specific props if (alt != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.alt = alt; } if (crossOrigin != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.crossOrigin = crossOrigin; } if (height != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.height = height; } if (onError != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onError = function () { onError({ type: 'error' @@ -72,6 +78,7 @@ export function createStrictDOMImageComponent( }; } if (onLoad != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onLoad = function (e) { const { source } = e.nativeEvent; onLoad({ @@ -84,20 +91,25 @@ export function createStrictDOMImageComponent( }; } if (referrerPolicy != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.referrerPolicy = referrerPolicy; } if (src != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.src = src; } if (srcSet != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.srcSet = srcSet; } if (width != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.width = width; } // Component-specific props + // $FlowFixMe[react-rule-hook-mutation] nativeProps.ref = elementRef; // Use Animated components if necessary @@ -109,7 +121,7 @@ export function createStrictDOMImageComponent( typeof props.children === 'function' ? ( props.children(nativeProps) ) : ( - // $FlowFixMe + // $FlowFixMe[incompatible-type] ); diff --git a/packages/react-strict-dom/src/native/modules/createStrictDOMTextComponent.js b/packages/react-strict-dom/src/native/modules/createStrictDOMTextComponent.js index bf9f30a0..cbfc8c3e 100644 --- a/packages/react-strict-dom/src/native/modules/createStrictDOMTextComponent.js +++ b/packages/react-strict-dom/src/native/modules/createStrictDOMTextComponent.js @@ -33,7 +33,9 @@ export function createStrictDOMTextComponent( defaultProps?: P ): component(ref?: React.RefSetter, ...P) { component Component(ref?: React.RefSetter, ...props: P) { - let NativeComponent = ReactNative.Text; + let NativeComponent: + | typeof ReactNative.Text + | typeof ReactNative.Animated.Text = ReactNative.Text; const elementRef = useStrictDOMElement(ref, { tagName }); const { href, label } = props; @@ -48,6 +50,7 @@ export function createStrictDOMTextComponent( { provideInheritableStyle: tagName !== 'br' || + // $FlowFixMe[invalid-compare] tagName !== 'option' || hasElementChildren(props.children), withInheritedStyle: true, @@ -58,8 +61,10 @@ export function createStrictDOMTextComponent( // Tag-specific props if (tagName === 'a') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role ??= 'link'; if (href != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPress = function (e) { if (__DEV__) { errorMsg(' "href" handling is not implemented in React Native.'); @@ -67,6 +72,7 @@ export function createStrictDOMTextComponent( }; } } else if (tagName === 'br') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.children = '\n'; } else if ( tagName === 'h1' || @@ -76,13 +82,16 @@ export function createStrictDOMTextComponent( tagName === 'h5' || tagName === 'h6' ) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role ??= 'heading'; } else if (tagName === 'option') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.children = label; } // Component-specific props + // $FlowFixMe[react-rule-hook-mutation] nativeProps.ref = elementRef; // Workaround: Android doesn't support ellipsis truncation if Text is selectable @@ -93,6 +102,7 @@ export function createStrictDOMTextComponent( nativeProps.style.userSelect !== 'none'; // $FlowExpectedError[unsafe-object-assign] + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style = Object.assign( nativeProps.style, disableUserSelect ? { userSelect: 'none' } : null @@ -101,7 +111,9 @@ export function createStrictDOMTextComponent( // Native components historically clip text. Opt into web-style default of // visible overflow by default if (nativeProps.style?.overflow == null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style = nativeProps.style ?? {}; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.overflow = 'visible'; } @@ -118,7 +130,7 @@ export function createStrictDOMTextComponent( typeof props.children === 'function' ? ( props.children(nativeProps) ) : ( - // $FlowFixMe + // $FlowFixMe[incompatible-type] ); diff --git a/packages/react-strict-dom/src/native/modules/createStrictDOMTextInputComponent.js b/packages/react-strict-dom/src/native/modules/createStrictDOMTextInputComponent.js index 794ff933..36373780 100644 --- a/packages/react-strict-dom/src/native/modules/createStrictDOMTextInputComponent.js +++ b/packages/react-strict-dom/src/native/modules/createStrictDOMTextInputComponent.js @@ -21,7 +21,7 @@ import { useStrictDOMElement } from './useStrictDOMElement'; const AnimatedTextInput = ReactNative.Animated.createAnimatedComponent< React.ElementConfig, typeof ReactNative.TextInput - // $FlowFixMe: React Native animated component typing issue + // $FlowFixMe[incompatible-type]: React Native animated component typing issue >(ReactNative.TextInput); // $FlowFixMe[unclear-type] @@ -101,9 +101,11 @@ export function createStrictDOMTextInputComponent( _inputMode = 'numeric'; } if (_inputMode != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.inputMode = _inputMode; } if (type === 'password') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.secureTextEntry = true; } if (type === 'checkbox' || type === 'date' || type === 'radio') { @@ -114,8 +116,10 @@ export function createStrictDOMTextInputComponent( } } } else if (tagName === 'textarea') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.multiline = true; if (rows != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.numberOfLines = rows; } } @@ -123,27 +127,36 @@ export function createStrictDOMTextInputComponent( // Component-specific props if (autoCapitalize != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.autoCapitalize = autoCapitalize; } if (autoComplete != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.autoComplete = autoComplete; } if (defaultValue != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.defaultValue = defaultValue; } if (disabled === true) { // polyfill disabled elements + // $FlowFixMe[react-rule-hook-mutation] nativeProps.disabled = true; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.editable = false; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.focusable = false; } if (enterKeyHint != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.enterKeyHint = enterKeyHint; } if (maxLength != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.maxLength = maxLength; } if (onChange != null || onInput != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onChange = function (e) { const { text, selection } = e.nativeEvent; // Update cached selection state immediately to ensure sync with onChange @@ -167,6 +180,7 @@ export function createStrictDOMTextInputComponent( }; } if (onKeyDown != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onKeyPress = function (e) { const { key } = e.nativeEvent; // Filter out bad iOS keypress data on submit @@ -181,6 +195,7 @@ export function createStrictDOMTextInputComponent( }); } }; + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onSubmitEditing = function (e) { onKeyDown({ key: 'Enter', @@ -189,6 +204,7 @@ export function createStrictDOMTextInputComponent( }; } // Part of polyfill for selectionStart/End + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onSelectionChange = function (e) { const { selection } = e.nativeEvent; updateCachedSelection(nodeRef.current, selection); @@ -197,18 +213,23 @@ export function createStrictDOMTextInputComponent( } }; if (placeholder != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.placeholder = placeholder; } if (readOnly != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.editable = !readOnly; } if (spellCheck != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.spellCheck = spellCheck; } if (value != null && typeof value === 'string') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.value = value; } + // $FlowFixMe[react-rule-hook-mutation] nativeProps.ref = React.useMemo( () => mergeRefs((node) => { @@ -226,7 +247,7 @@ export function createStrictDOMTextInputComponent( typeof props.children === 'function' ? ( props.children(nativeProps) ) : ( - // $FlowFixMe + // $FlowFixMe[incompatible-type] ); diff --git a/packages/react-strict-dom/src/native/modules/extractStyleThemes.js b/packages/react-strict-dom/src/native/modules/extractStyleThemes.js index 66f08c08..2dd8ab53 100644 --- a/packages/react-strict-dom/src/native/modules/extractStyleThemes.js +++ b/packages/react-strict-dom/src/native/modules/extractStyleThemes.js @@ -9,7 +9,7 @@ import type { CustomProperties, Style, Styles } from '../../types/styles'; -const emptyValue = [{}, null]; +const emptyValue: [Style, ?CustomProperties] = [{}, null]; export function extractStyleThemes( mixOfStyleAndTheme: ?Styles | Style | Array diff --git a/packages/react-strict-dom/src/native/modules/useNativeProps.js b/packages/react-strict-dom/src/native/modules/useNativeProps.js index 0c824c85..22c08372 100644 --- a/packages/react-strict-dom/src/native/modules/useNativeProps.js +++ b/packages/react-strict-dom/src/native/modules/useNativeProps.js @@ -60,6 +60,7 @@ type EventHandler = | ReactNativeProps['onPointerUp'] | ReactNativeProps['onPointerLeave']; +// $FlowFixMe[incompatible-type] function combineEventHandlers(a: EventHandler, b: EventHandler): $FlowFixMe { if (a == null) { return b; @@ -168,6 +169,7 @@ export function useNativeProps( const displayValue = nativeProps.style.display; // 'hidden' polyfill (only if "display" is not set) if (displayValue == null && hidden && hidden !== 'until-found') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.style.display = 'none'; } @@ -176,36 +178,46 @@ export function useNativeProps( */ if (typeof children !== 'function') { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.children = children; } if (ariaHidden != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityElementsHidden = ariaHidden; if (ariaHidden === true) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.importantForAccessibility = 'no-hide-descendants'; } } if (ariaLabel != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityLabel = ariaLabel; } if (ariaLabelledBy != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityLabelledBy = ariaLabelledBy?.split(/\s*,\s*/g); } if (ariaLive != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityLiveRegion = ariaLive === 'off' ? 'none' : ariaLive; } if (ariaModal != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityViewIsModal = ariaModal; } if (ariaPosInSet != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityPosInSet = ariaPosInSet; } const ariaRole = role; if (ariaRole) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.role = ariaRole; } if (ariaSetSize != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilitySetSize = ariaSetSize; } if ( @@ -215,6 +227,7 @@ export function useNativeProps( ariaExpanded != null || ariaSelected != null ) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityState = { busy: ariaBusy, checked: ariaChecked, @@ -229,6 +242,7 @@ export function useNativeProps( ariaValueNow != null || ariaValueText != null ) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.accessibilityValue = { max: ariaValueMax, min: ariaValueMin, @@ -237,22 +251,28 @@ export function useNativeProps( }; } if (dataTestID != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.testID = dataTestID; } if (id != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.nativeID = id; } if (tabIndex != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.focusable = !tabIndex; } // Events if (onBlur != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onBlur = combineEventHandlers(nativeProps.onBlur, onBlur); } // TODO: remove once PointerEvent onClick is available if (onClick != null) { + // $FlowFixMe[react-rule-hook-mutation] + // $FlowFixMe[missing-local-annot] nativeProps.onPress = function ({ nativeEvent }) { const event: mixed = nativeEvent; let altKey = false; @@ -308,90 +328,112 @@ export function useNativeProps( }; } if (onFocus != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onFocus = combineEventHandlers(nativeProps.onFocus, onFocus); } if (onGotPointerCapture != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onGotPointerCapture = onGotPointerCapture; } if (onLostPointerCapture != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onLostPointerCapture = onLostPointerCapture; } if (onMouseDown != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onMouseDown = onMouseDown; } if (onMouseEnter != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onMouseEnter = combineEventHandlers( nativeProps.onMouseEnter, onMouseEnter ); } if (onMouseLeave != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onMouseLeave = combineEventHandlers( nativeProps.onMouseLeave, onMouseLeave ); } if (onMouseOut != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onMouseOut = onMouseOut; } if (onMouseOver != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onMouseOver = onMouseOver; } if (onMouseUp != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onMouseUp = onMouseUp; } if (onPointerCancel != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerCancel = combineEventHandlers( nativeProps.onPointerCancel, onPointerCancel ); } if (onPointerDown != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerDown = combineEventHandlers( nativeProps.onPointerDown, onPointerDown ); } if (onPointerEnter != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerEnter = combineEventHandlers( nativeProps.onPointerEnter, onPointerEnter ); } if (onPointerLeave != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerLeave = combineEventHandlers( nativeProps.onPointerLeave, onPointerLeave ); } if (onPointerMove != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerMove = onPointerMove; } if (onPointerOut != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerOut = onPointerOut; } if (onPointerOver != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerOver = onPointerOver; } if (onPointerUp != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onPointerUp = combineEventHandlers( nativeProps.onPointerUp, onPointerUp ); } if (onScroll != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onScroll = onScroll; } if (onTouchCancel != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onTouchCancel = onTouchCancel; } if (onTouchEnd != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onTouchEnd = onTouchEnd; } if (onTouchMove != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onTouchMove = onTouchMove; } if (onTouchStart != null) { + // $FlowFixMe[react-rule-hook-mutation] nativeProps.onTouchStart = onTouchStart; } diff --git a/packages/react-strict-dom/src/native/modules/useStyleProps.js b/packages/react-strict-dom/src/native/modules/useStyleProps.js index ca99c149..698be171 100644 --- a/packages/react-strict-dom/src/native/modules/useStyleProps.js +++ b/packages/react-strict-dom/src/native/modules/useStyleProps.js @@ -144,8 +144,10 @@ export function useStyleProps( if (handlers != null) { for (const handler of eventHandlerNames) { + // $FlowFixMe[invalid-computed-prop] const handlerValue = handlers[handler]; if (handlerValue != null) { + // $FlowFixMe[prop-missing] styleProps[handler] = handlerValue; } } @@ -194,6 +196,7 @@ export function useStyleProps( for (const key of inheritedProperties) { const value = styleProps.style[key]; + // $FlowFixMe[invalid-computed-prop] const inheritedValue = inheritedValues[key]; let val = value; diff --git a/packages/react-strict-dom/src/native/modules/useStyleTransition.js b/packages/react-strict-dom/src/native/modules/useStyleTransition.js index c9aca588..db99a0af 100644 --- a/packages/react-strict-dom/src/native/modules/useStyleTransition.js +++ b/packages/react-strict-dom/src/native/modules/useStyleTransition.js @@ -54,6 +54,7 @@ function canUseNativeDriver( if ( property === 'transform' && Array.isArray(value) && + // $FlowFixMe[incompatible-type] !value.includes('skew') ) { continue; diff --git a/packages/react-strict-dom/src/native/modules/version.js b/packages/react-strict-dom/src/native/modules/version.js index 97e7e523..aeaaf67b 100644 --- a/packages/react-strict-dom/src/native/modules/version.js +++ b/packages/react-strict-dom/src/native/modules/version.js @@ -7,7 +7,7 @@ * @flow strict */ -// $FlowFixMe(nonstrict-import) +// $FlowFixMe[nonstrict-import] import * as ReactNative from '../react-native'; const reactNativeVersion = ReactNative.Platform.constants.reactNativeVersion; diff --git a/packages/react-strict-dom/src/web/html.js b/packages/react-strict-dom/src/web/html.js index dc60eb9e..944a23d1 100644 --- a/packages/react-strict-dom/src/web/html.js +++ b/packages/react-strict-dom/src/web/html.js @@ -28,7 +28,10 @@ import { defaultStyles } from './runtime'; export const a: component( ref?: React.RefSetter, ...StrictReactDOMAnchorProps -) = createStrict('a', defaultStyles.a); +) = createStrict( + 'a', + defaultStyles.a +); /** * "article" (block) @@ -36,7 +39,10 @@ export const a: component( export const article: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('article', defaultStyles.article); +) = createStrict( + 'article', + defaultStyles.article +); /** * "aside" (block) @@ -44,7 +50,10 @@ export const article: component( export const aside: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('aside', defaultStyles.aside); +) = createStrict( + 'aside', + defaultStyles.aside +); /** * "b" (inline) @@ -52,7 +61,7 @@ export const aside: component( export const b: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('b', defaultStyles.b); +) = createStrict('b', defaultStyles.b); /** * "bdi" (inline) @@ -60,7 +69,7 @@ export const b: component( export const bdi: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('bdi', defaultStyles.bdi); +) = createStrict('bdi', defaultStyles.bdi); /** * "bdo" (inline) @@ -68,7 +77,7 @@ export const bdi: component( export const bdo: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('bdo', defaultStyles.bdo); +) = createStrict('bdo', defaultStyles.bdo); /** * "blockquote" (block) @@ -76,7 +85,10 @@ export const bdo: component( export const blockquote: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('blockquote', defaultStyles.blockquote); +) = createStrict( + 'blockquote', + defaultStyles.blockquote +); /** * "br" @@ -84,7 +96,7 @@ export const blockquote: component( export const br: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('br', defaultStyles.br); +) = createStrict('br', defaultStyles.br); /** * "button" (inline-block) @@ -92,7 +104,10 @@ export const br: component( export const button: component( ref?: React.RefSetter, ...StrictReactDOMButtonProps -) = createStrict('button', defaultStyles.button); +) = createStrict( + 'button', + defaultStyles.button +); /** * "code" (inline) @@ -100,7 +115,7 @@ export const button: component( export const code: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('code', defaultStyles.code); +) = createStrict('code', defaultStyles.code); /** * "del" (inline) @@ -108,7 +123,7 @@ export const code: component( export const del: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('del', defaultStyles.del); +) = createStrict('del', defaultStyles.del); /** * "div" (block) @@ -116,7 +131,7 @@ export const del: component( export const div: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('div', defaultStyles.div); +) = createStrict('div', defaultStyles.div); /** * "em" (inline) @@ -124,7 +139,7 @@ export const div: component( export const em: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('em', defaultStyles.em); +) = createStrict('em', defaultStyles.em); /** * "fieldset" (block) @@ -132,7 +147,10 @@ export const em: component( export const fieldset: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('fieldset', defaultStyles.fieldset); +) = createStrict( + 'fieldset', + defaultStyles.fieldset +); /** * "footer" (block) @@ -140,7 +158,10 @@ export const fieldset: component( export const footer: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('footer', defaultStyles.footer); +) = createStrict( + 'footer', + defaultStyles.footer +); /** * "form" (block) @@ -148,7 +169,10 @@ export const footer: component( export const form: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('form', defaultStyles.form); +) = createStrict( + 'form', + defaultStyles.form +); /** * "h1-h6" (block) @@ -156,27 +180,45 @@ export const form: component( export const h1: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('h1', defaultStyles.h1); +) = createStrict( + 'h1', + defaultStyles.h1 +); export const h2: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('h2', defaultStyles.h2); +) = createStrict( + 'h2', + defaultStyles.h2 +); export const h3: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('h3', defaultStyles.h3); +) = createStrict( + 'h3', + defaultStyles.h3 +); export const h4: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('h4', defaultStyles.h4); +) = createStrict( + 'h4', + defaultStyles.h4 +); export const h5: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('h5', defaultStyles.h5); +) = createStrict( + 'h5', + defaultStyles.h5 +); export const h6: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('h6', defaultStyles.h6); +) = createStrict( + 'h6', + defaultStyles.h6 +); /** * "header" (block) @@ -184,7 +226,10 @@ export const h6: component( export const header: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('header', defaultStyles.header); +) = createStrict( + 'header', + defaultStyles.header +); /** * "hr" (block) @@ -192,7 +237,7 @@ export const header: component( export const hr: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('hr', defaultStyles.hr); +) = createStrict('hr', defaultStyles.hr); /** * "i" (inline) @@ -200,7 +245,7 @@ export const hr: component( export const i: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('i', defaultStyles.i); +) = createStrict('i', defaultStyles.i); /** * "img" (inline) @@ -208,7 +253,10 @@ export const i: component( export const img: component( ref?: React.RefSetter, ...StrictReactDOMImageProps -) = createStrict('img', defaultStyles.img); +) = createStrict( + 'img', + defaultStyles.img +); /** * "input" (inline-block) @@ -216,7 +264,10 @@ export const img: component( export const input: component( ref?: React.RefSetter, ...StrictReactDOMInputProps -) = createStrict('input', defaultStyles.input); +) = createStrict( + 'input', + defaultStyles.input +); /** * "ins" (inline) @@ -224,7 +275,7 @@ export const input: component( export const ins: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('ins', defaultStyles.ins); +) = createStrict('ins', defaultStyles.ins); /** * "kbd" (inline) @@ -232,7 +283,7 @@ export const ins: component( export const kbd: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('kbd', defaultStyles.kbd); +) = createStrict('kbd', defaultStyles.kbd); /** * "label" (inline) @@ -240,7 +291,10 @@ export const kbd: component( export const label: component( ref?: React.RefSetter, ...StrictReactDOMLabelProps -) = createStrict('label', defaultStyles.label); +) = createStrict( + 'label', + defaultStyles.label +); /** * "li" (block) @@ -248,7 +302,10 @@ export const label: component( export const li: component( ref?: React.RefSetter, ...StrictReactDOMListItemProps -) = createStrict('li', defaultStyles.li); +) = createStrict( + 'li', + defaultStyles.li +); /** * "main" (block) @@ -256,7 +313,7 @@ export const li: component( export const main: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('main', defaultStyles.main); +) = createStrict('main', defaultStyles.main); /** * "mark" (inline) @@ -264,7 +321,7 @@ export const main: component( export const mark: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('mark', defaultStyles.mark); +) = createStrict('mark', defaultStyles.mark); /** * "nav" (block) @@ -272,7 +329,7 @@ export const mark: component( export const nav: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('nav', defaultStyles.nav); +) = createStrict('nav', defaultStyles.nav); /** * "ol" (block) @@ -280,7 +337,7 @@ export const nav: component( export const ol: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('ol', defaultStyles.ol); +) = createStrict('ol', defaultStyles.ol); /** * "optgroup" @@ -288,7 +345,10 @@ export const ol: component( export const optgroup: component( ref?: React.RefSetter, ...StrictReactDOMOptionGroupProps -) = createStrict('optgroup', defaultStyles.optgroup); +) = createStrict( + 'optgroup', + defaultStyles.optgroup +); /** * "option" @@ -307,7 +367,10 @@ export const option: component( export const p: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('p', defaultStyles.p); +) = createStrict( + 'p', + defaultStyles.p +); /** * "pre" (block) @@ -315,7 +378,7 @@ export const p: component( export const pre: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('pre', defaultStyles.pre); +) = createStrict('pre', defaultStyles.pre); /** * "s" (inline) @@ -323,7 +386,7 @@ export const pre: component( export const s: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('s', defaultStyles.s); +) = createStrict('s', defaultStyles.s); /** * "section" (block) @@ -331,7 +394,10 @@ export const s: component( export const section: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('section', defaultStyles.section); +) = createStrict( + 'section', + defaultStyles.section +); /** * "select" (inline-block) @@ -339,7 +405,10 @@ export const section: component( export const select: component( ref?: React.RefSetter, ...StrictReactDOMSelectProps -) = createStrict('select', defaultStyles.select); +) = createStrict( + 'select', + defaultStyles.select +); /** * "span" (inline) @@ -347,7 +416,10 @@ export const select: component( export const span: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('span', defaultStyles.span); +) = createStrict( + 'span', + defaultStyles.span +); /** * "strong" (inline) @@ -355,7 +427,10 @@ export const span: component( export const strong: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('strong', defaultStyles.strong); +) = createStrict( + 'strong', + defaultStyles.strong +); /** * "sub" (inline) @@ -363,7 +438,7 @@ export const strong: component( export const sub: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('sub', defaultStyles.sub); +) = createStrict('sub', defaultStyles.sub); /** * "sup" (inline) @@ -371,7 +446,7 @@ export const sub: component( export const sup: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('sup', defaultStyles.sup); +) = createStrict('sup', defaultStyles.sup); /** * "textarea" (inline-block) @@ -379,7 +454,10 @@ export const sup: component( export const textarea: component( ref?: React.RefSetter, ...StrictReactDOMTextAreaProps -) = createStrict('textarea', defaultStyles.textarea); +) = createStrict( + 'textarea', + defaultStyles.textarea +); /** * "u" (inline) @@ -387,7 +465,7 @@ export const textarea: component( export const u: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('u', defaultStyles.u); +) = createStrict('u', defaultStyles.u); /** * "ul" (block) @@ -395,4 +473,4 @@ export const u: component( export const ul: component( ref?: React.RefSetter, ...StrictReactDOMProps -) = createStrict('ul', defaultStyles.ul); +) = createStrict('ul', defaultStyles.ul); diff --git a/packages/react-strict-dom/src/web/modules/createStrictDOMComponent.js b/packages/react-strict-dom/src/web/modules/createStrictDOMComponent.js index e582ed24..64cd69fb 100644 --- a/packages/react-strict-dom/src/web/modules/createStrictDOMComponent.js +++ b/packages/react-strict-dom/src/web/modules/createStrictDOMComponent.js @@ -51,7 +51,7 @@ export function createStrictDOMComponent( } if (props.role != null) { // "presentation" synonym has wider browser support - // $FlowFixMe + // $FlowFixMe[incompatible-type] hostProps.role = props.role === 'none' ? 'presentation' : props.role; } if (TagName === 'button') { @@ -63,7 +63,7 @@ export function createStrictDOMComponent( /** * get host style props */ - // $FlowFixMe + // $FlowFixMe[incompatible-type] const hostStyleProps: ReactDOMStyleProps = merge([ debugStyle, defaultStyle, diff --git a/packages/react-strict-dom/src/web/runtime.js b/packages/react-strict-dom/src/web/runtime.js index c1b08bd2..e7b24009 100644 --- a/packages/react-strict-dom/src/web/runtime.js +++ b/packages/react-strict-dom/src/web/runtime.js @@ -81,52 +81,88 @@ const styles = stylex.create({ } }); +// $FlowFixMe[incompatible-type] const a: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const article: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const aside: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const b: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const bdi: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const bdo: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const blockquote: StrictReactDOMPropsStyle = styles.block; const br: StrictReactDOMPropsStyle = null; +// $FlowFixMe[incompatible-type] const button: StrictReactDOMPropsStyle = [styles.inlineblock, styles.button]; +// $FlowFixMe[incompatible-type] const code: StrictReactDOMPropsStyle = [styles.inline, styles.codePre]; const del: StrictReactDOMPropsStyle = null; +// $FlowFixMe[incompatible-type] const div: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const em: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const fieldset: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const footer: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const form: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const heading: StrictReactDOMPropsStyle = [styles.block, styles.heading]; +// $FlowFixMe[incompatible-type] const header: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const hr: StrictReactDOMPropsStyle = [styles.block, styles.hr]; +// $FlowFixMe[incompatible-type] const i: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const img: StrictReactDOMPropsStyle = styles.img; +// $FlowFixMe[incompatible-type] const input: StrictReactDOMPropsStyle = [styles.inlineblock, styles.input]; const ins: StrictReactDOMPropsStyle = null; const kbd: StrictReactDOMPropsStyle = null; +// $FlowFixMe[incompatible-type] const label: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const li: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const main: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const mark: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const nav: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const ol: StrictReactDOMPropsStyle = [styles.list, styles.block]; const optgroup: StrictReactDOMPropsStyle = null; const option: StrictReactDOMPropsStyle = null; +// $FlowFixMe[incompatible-type] const p: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const pre: StrictReactDOMPropsStyle = [styles.block, styles.codePre]; const s: StrictReactDOMPropsStyle = null; +// $FlowFixMe[incompatible-type] const section: StrictReactDOMPropsStyle = styles.block; +// $FlowFixMe[incompatible-type] const select: StrictReactDOMPropsStyle = styles.inlineblock; +// $FlowFixMe[incompatible-type] const span: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const strong: StrictReactDOMPropsStyle = [styles.inline, styles.strong]; +// $FlowFixMe[incompatible-type] const sub: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const sup: StrictReactDOMPropsStyle = styles.inline; +// $FlowFixMe[incompatible-type] const textarea: StrictReactDOMPropsStyle = [ styles.inlineblock, styles.textarea ]; const u: StrictReactDOMPropsStyle = null; +// $FlowFixMe[incompatible-type] const ul: StrictReactDOMPropsStyle = [styles.list, styles.block]; export const defaultStyles = {