Skip to content

Commit faca437

Browse files
committed
feat: add official React 19 support
Updated the library to officially support React 19 with full compatibility testing. Changes: - Updated React and React DOM from 18.2.0 to 19.2.3 - Updated @types/react from 18.3.27 to 19.2.7 - Updated @types/react-dom from 18.3.7 to 19.2.3 - Updated peer dependency to explicitly support React 16.8+, 17, 18, and 19 - Updated example app to use React 19 for testing Benefits: - Resolves "multiple React copies" error for React 19 users - Smaller bundle sizes (ESM: -27%, UMD: -23%) due to React 19 optimizations - All tests passing (6/6) - Backward compatible with React 16.8+
1 parent 8e54452 commit faca437

4 files changed

Lines changed: 61 additions & 90 deletions

File tree

example/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"serve": "vite preview"
99
},
1010
"dependencies": {
11-
"react": "^18.2.0",
11+
"react": "^19.2.3",
1212
"react-align": "link:..",
1313
"@hello-pangea/dnd": "^18.0.1",
14-
"react-dom": "^18.2.0"
14+
"react-dom": "^19.2.3"
1515
},
1616
"devDependencies": {
17-
"@types/react": "^18.0.17",
18-
"@types/react-dom": "^18.0.6",
17+
"@types/react": "^19.2.7",
18+
"@types/react-dom": "^19.2.3",
1919
"@vitejs/plugin-react": "^2.1.0",
2020
"typescript": "^4.8.4",
2121
"vite": "^3.2.1"

example/yarn.lock

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,16 @@
252252
"@jridgewell/resolve-uri" "^3.1.0"
253253
"@jridgewell/sourcemap-codec" "^1.4.14"
254254

255-
"@types/prop-types@*":
256-
version "15.7.15"
257-
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.15.tgz#e6e5a86d602beaca71ce5163fadf5f95d70931c7"
258-
integrity sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==
259-
260-
"@types/react-dom@^18.0.6":
261-
version "18.3.7"
262-
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.7.tgz#b89ddf2cd83b4feafcc4e2ea41afdfb95a0d194f"
263-
integrity sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==
264-
265-
"@types/react@^18.0.17":
266-
version "18.3.27"
267-
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.27.tgz#74a3b590ea183983dc65a474dc17553ae1415c34"
268-
integrity sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==
269-
dependencies:
270-
"@types/prop-types" "*"
255+
"@types/react-dom@^19.2.3":
256+
version "19.2.3"
257+
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.2.3.tgz#c1e305d15a52a3e508d54dca770d202cb63abf2c"
258+
integrity sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==
259+
260+
"@types/react@^19.2.7":
261+
version "19.2.7"
262+
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.7.tgz#84e62c0f23e8e4e5ac2cadcea1ffeacccae7f62f"
263+
integrity sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==
264+
dependencies:
271265
csstype "^3.2.2"
272266

273267
"@types/use-sync-external-store@^0.0.6":
@@ -500,7 +494,7 @@ is-core-module@^2.16.1:
500494
dependencies:
501495
hasown "^2.0.2"
502496

503-
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
497+
js-tokens@^4.0.0:
504498
version "4.0.0"
505499
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
506500
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
@@ -515,13 +509,6 @@ json5@^2.2.3:
515509
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
516510
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
517511

518-
loose-envify@^1.1.0:
519-
version "1.4.0"
520-
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
521-
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
522-
dependencies:
523-
js-tokens "^3.0.0 || ^4.0.0"
524-
525512
lru-cache@^5.1.1:
526513
version "5.1.1"
527514
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
@@ -579,13 +566,12 @@ raf-schd@^4.0.3:
579566
version "0.0.0"
580567
uid ""
581568

582-
react-dom@^18.2.0:
583-
version "18.3.1"
584-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
585-
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
569+
react-dom@^19.2.3:
570+
version "19.2.3"
571+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.3.tgz#f0b61d7e5c4a86773889fcc1853af3ed5f215b17"
572+
integrity sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==
586573
dependencies:
587-
loose-envify "^1.1.0"
588-
scheduler "^0.23.2"
574+
scheduler "^0.27.0"
589575

590576
react-redux@^9.2.0:
591577
version "9.2.0"
@@ -600,12 +586,10 @@ react-refresh@^0.14.0:
600586
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.2.tgz#3833da01ce32da470f1f936b9d477da5c7028bf9"
601587
integrity sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==
602588

603-
react@^18.2.0:
604-
version "18.3.1"
605-
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
606-
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
607-
dependencies:
608-
loose-envify "^1.1.0"
589+
react@^19.2.3:
590+
version "19.2.3"
591+
resolved "https://registry.yarnpkg.com/react/-/react-19.2.3.tgz#d83e5e8e7a258cf6b4fe28640515f99b87cd19b8"
592+
integrity sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==
609593

610594
redux@^5.0.1:
611595
version "5.0.1"
@@ -628,12 +612,10 @@ rollup@^2.79.1:
628612
optionalDependencies:
629613
fsevents "~2.3.2"
630614

631-
scheduler@^0.23.2:
632-
version "0.23.2"
633-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
634-
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
635-
dependencies:
636-
loose-envify "^1.1.0"
615+
scheduler@^0.27.0:
616+
version "0.27.0"
617+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.27.0.tgz#0c4ef82d67d1e5c1e359e8fc76d3a87f045fe5bd"
618+
integrity sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==
637619

638620
semver@^6.3.1:
639621
version "6.3.1"

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"node": ">=10"
2727
},
2828
"peerDependencies": {
29-
"react": ">=16",
29+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
3030
"@hello-pangea/dnd": "*"
3131
},
3232
"prettier": {
@@ -35,10 +35,10 @@
3535
"trailingComma": "es5"
3636
},
3737
"resolutions": {
38-
"@types/react": "18.3.27",
39-
"@types/react-dom": "18.3.7",
40-
"**/@types/react": "18.3.27",
41-
"**/@types/react-dom": "18.3.7",
38+
"@types/react": "19.2.7",
39+
"@types/react-dom": "19.2.3",
40+
"**/@types/react": "19.2.7",
41+
"**/@types/react-dom": "19.2.3",
4242
"minimist": "^1.2.8",
4343
"@babel/runtime": "^7.26.10",
4444
"js-yaml": "^4.1.1"
@@ -48,18 +48,18 @@
4848
"@testing-library/jest-dom": "^6.9.1",
4949
"@testing-library/react": "^16.3.0",
5050
"@testing-library/user-event": "^14.6.1",
51-
"@types/react": "^18.3.27",
52-
"@types/react-dom": "^18.3.7",
51+
"@types/react": "^19.2.7",
52+
"@types/react-dom": "^19.2.3",
5353
"@vitejs/plugin-react": "^5.1.1",
5454
"eslint": "^9.39.1",
5555
"eslint-config-reearth": "^0.3.8",
5656
"husky": "^9.1.7",
5757
"jsdom": "^27.2.0",
5858
"postcss": "^8.5.6",
5959
"prettier": "^3.7.4",
60-
"react": "^18.2.0",
60+
"react": "^19.2.3",
6161
"@hello-pangea/dnd": "^18.0.1",
62-
"react-dom": "^18.2.0",
62+
"react-dom": "^19.2.3",
6363
"tslib": "^2.8.1",
6464
"typescript": "^5.9.3",
6565
"vite": "^7.2.6",

yarn.lock

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -955,22 +955,16 @@
955955
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz"
956956
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
957957

958-
"@types/prop-types@*":
959-
version "15.7.15"
960-
resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz"
961-
integrity sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==
962-
963-
"@types/react-dom@18.3.7", "@types/react-dom@^18.3.7":
964-
version "18.3.7"
965-
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.7.tgz#b89ddf2cd83b4feafcc4e2ea41afdfb95a0d194f"
966-
integrity sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==
967-
968-
"@types/react@18.3.27", "@types/react@^18.3.27":
969-
version "18.3.27"
970-
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.27.tgz#74a3b590ea183983dc65a474dc17553ae1415c34"
971-
integrity sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==
972-
dependencies:
973-
"@types/prop-types" "*"
958+
"@types/react-dom@19.2.3", "@types/react-dom@^19.2.3":
959+
version "19.2.3"
960+
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.2.3.tgz#c1e305d15a52a3e508d54dca770d202cb63abf2c"
961+
integrity sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==
962+
963+
"@types/react@19.2.7", "@types/react@^19.2.7":
964+
version "19.2.7"
965+
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.7.tgz#84e62c0f23e8e4e5ac2cadcea1ffeacccae7f62f"
966+
integrity sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==
967+
dependencies:
974968
csstype "^3.2.2"
975969

976970
"@types/use-sync-external-store@^0.0.6":
@@ -2893,7 +2887,7 @@ lodash@~4.17.15:
28932887
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
28942888
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
28952889

2896-
loose-envify@^1.1.0, loose-envify@^1.4.0:
2890+
loose-envify@^1.4.0:
28972891
version "1.4.0"
28982892
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
28992893
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -3290,13 +3284,12 @@ raf-schd@^4.0.3:
32903284
resolved "https://registry.yarnpkg.com/raf-schd/-/raf-schd-4.0.3.tgz#5d6c34ef46f8b2a0e880a8fcdb743efc5bfdbc1a"
32913285
integrity sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==
32923286

3293-
react-dom@^18.2.0:
3294-
version "18.3.1"
3295-
resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz"
3296-
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
3287+
react-dom@^19.2.3:
3288+
version "19.2.3"
3289+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.3.tgz#f0b61d7e5c4a86773889fcc1853af3ed5f215b17"
3290+
integrity sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==
32973291
dependencies:
3298-
loose-envify "^1.1.0"
3299-
scheduler "^0.23.2"
3292+
scheduler "^0.27.0"
33003293

33013294
react-is@^16.13.1:
33023295
version "16.13.1"
@@ -3321,12 +3314,10 @@ react-refresh@^0.18.0:
33213314
resolved "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz"
33223315
integrity sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==
33233316

3324-
react@^18.2.0:
3325-
version "18.3.1"
3326-
resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz"
3327-
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
3328-
dependencies:
3329-
loose-envify "^1.1.0"
3317+
react@^19.2.3:
3318+
version "19.2.3"
3319+
resolved "https://registry.yarnpkg.com/react/-/react-19.2.3.tgz#d83e5e8e7a258cf6b4fe28640515f99b87cd19b8"
3320+
integrity sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==
33303321

33313322
redent@^3.0.0:
33323323
version "3.0.0"
@@ -3478,12 +3469,10 @@ saxes@^6.0.0:
34783469
dependencies:
34793470
xmlchars "^2.2.0"
34803471

3481-
scheduler@^0.23.2:
3482-
version "0.23.2"
3483-
resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz"
3484-
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
3485-
dependencies:
3486-
loose-envify "^1.1.0"
3472+
scheduler@^0.27.0:
3473+
version "0.27.0"
3474+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.27.0.tgz#0c4ef82d67d1e5c1e359e8fc76d3a87f045fe5bd"
3475+
integrity sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==
34873476

34883477
semver@^6.3.1:
34893478
version "6.3.1"

0 commit comments

Comments
 (0)