|
@@ -86,6 +86,18 @@ def _determine_nextjs_version() -> str:
|
|
|
return default_version
|
|
|
|
|
|
|
|
|
+def _determine_react_version() -> str:
|
|
|
+ default_version = "19.1.0"
|
|
|
+ if (version := os.getenv("REACT_VERSION")) and version != default_version:
|
|
|
+ from reflex.utils import console
|
|
|
+
|
|
|
+ console.warn(
|
|
|
+ f"You have requested react@{version} but the supported version is {default_version}, abandon all hope ye who enter here."
|
|
|
+ )
|
|
|
+ return version
|
|
|
+ return default_version
|
|
|
+
|
|
|
+
|
|
|
class PackageJson(SimpleNamespace):
|
|
|
"""Constants used to build the package.json file."""
|
|
|
|
|
@@ -99,6 +111,8 @@ class PackageJson(SimpleNamespace):
|
|
|
|
|
|
PATH = "package.json"
|
|
|
|
|
|
+ _react_version = _determine_react_version()
|
|
|
+
|
|
|
DEPENDENCIES = {
|
|
|
"@emotion/react": "11.14.0",
|
|
|
"axios": "1.9.0",
|
|
@@ -106,8 +120,8 @@ class PackageJson(SimpleNamespace):
|
|
|
"next": _determine_nextjs_version(),
|
|
|
"next-sitemap": "4.2.3",
|
|
|
"next-themes": "0.4.6",
|
|
|
- "react": "19.1.0",
|
|
|
- "react-dom": "19.1.0",
|
|
|
+ "react": _react_version,
|
|
|
+ "react-dom": _react_version,
|
|
|
"react-focus-lock": "2.13.6",
|
|
|
"socket.io-client": "4.8.1",
|
|
|
"universal-cookie": "7.2.2",
|
|
@@ -119,5 +133,5 @@ class PackageJson(SimpleNamespace):
|
|
|
}
|
|
|
OVERRIDES = {
|
|
|
# This should always match the `react` version in DEPENDENCIES for recharts compatibility.
|
|
|
- "react-is": "19.1.0"
|
|
|
+ "react-is": _react_version
|
|
|
}
|