GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — JSX Fragments are in-properly typed with `<></>` syntax, when using `react-jsx` JSX option · Issue #62358 · microsoft/TypeScript Open Labels Milestone Description🔎 Search TermsJSX, Fragment, children type 🕗 Version & Regression InformationBug exists since TypeScript introduces ⏯ Playground Linkhttps://stackblitz.com/edit/stackblitz-starters-sffhmvvz?file=index.tsx 💻 Codeimport { Fragment } from "@/jsx-runtime"; <Fragment> {"ok"} {({ foo }) => "also ok"} </Fragment>; <> {"ok"} {({ foo }) => "not ok"} {/* ^ Binding element 'foo' implicitly has an 'any' type. */} </>; With following export const jsx = (...args: unknown[]) => {}; type JsxElement = | JsxElementArray | undefined | string | ((arg: { foo: "bar " }) => void); interface JsxElementArray extends Array<JsxElement> {} interface FragmentProps { children?: JsxElement; } export const Fragment = (props: FragmentProps) => {}; and tsconfig: {
"compilerOptions": {
"strict": true,
"jsx": "react-jsx",
"jsxImportSource": "@",
// [...]
}
}🙁 Actual behaviorThe first JSX expression using 🙂 Expected behaviorThese two JSX expressions should both pass the type checking. Additional information about the issueThis issue was first mentioned at #50429 and fixed in #59933, but the fix only take effects on Reacted by Arnaud Barré, Nicolas DUBIEN, Nico and Remco Haszing Reacted by Copilot Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |