You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mostly filing this for others to discover if they run into the same issue. I understand that you probably won't make a change to the typings to address this issue, but it would be nice to update the v8.x migration guide to mention this additional breaking change.
Bug description
When upgrading to react-day-picker v8.x in a TypeScript project, I encountered this compilation error:
node_modules/.pnpm/react-day-picker@8.8.2_67dtbe47ihz5epdhb3oajtg74u/node_modules/react-day-picker/dist/index.d.ts:2:8 - error TS1259: Module '"/home/circleci/project/node_modules/.pnpm/@types+react@16.14.32/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
2 import React$1, { ReactNode, HTMLProps } from 'react';
~~~~~~~
node_modules/.pnpm/@types+react@16.14.32/node_modules/@types/react/index.d.ts:61:1
61 export = React;
~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
Note that I am currently using @types/react v16.x, but the same issue would apply to the latest v18.x types.
@gpbl does that mean you'll try to change the emitted react-day-picker/dist/index.d.ts to use import * as React from "react" instead of import React from "react"? or will you update the breaking changes documentation?
Mostly filing this for others to discover if they run into the same issue. I understand that you probably won't make a change to the typings to address this issue, but it would be nice to update the v8.x migration guide to mention this additional breaking change.
Bug description
When upgrading to react-day-picker v8.x in a TypeScript project, I encountered this compilation error:
Note that I am currently using @types/react v16.x, but the same issue would apply to the latest v18.x types.
To reproduce
https://codesandbox.io/p/sandbox/react-daypicker-forked-vcg8w5?file=%2Ftsconfig.json%3A8%2C21
Need these tsconfig options:
Expected behavior
Either:
allowSyntheticDefaultImports: true
, ORThe text was updated successfully, but these errors were encountered: