react-component / react-component/tree

Namespace 'React' has no exported member 'JSX'

Open
#746 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
490
Avg merge
3d 17h
Merged PRs (30d)
5

Description

If I check TypeScript types inside an ESM package that (indirectly) uses rc-tree, I get type errors from inside node_modules:

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/DropIndicator.d.ts:6:11 - error TS2694: Namespace 'React' has no exported member 'JSX'.

6 }): React.JSX.Element;
            ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/Tree.d.ts:247:21 - error TS2694: Namespace 'React' has no exported member 'JSX'.

247     render(): React.JSX.Element;
                        ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:73:36 - error TS2694: Namespace 'React' has no exported member 'JSX'.

73     renderDragHandler: () => React.JSX.Element;
                                      ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:75:33 - error TS2694: Namespace 'React' has no exported member 'JSX'.

75     renderSwitcher: () => React.JSX.Element;
                                   ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:76:33 - error TS2694: Namespace 'React' has no exported member 'JSX'.

76     renderCheckbox: () => React.JSX.Element;
                                   ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:77:29 - error TS2694: Namespace 'React' has no exported member 'JSX'.

77     renderIcon: () => React.JSX.Element;
                               ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:78:33 - error TS2694: Namespace 'React' has no exported member 'JSX'.

78     renderSelector: () => React.JSX.Element;
                                   ~~~

../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:80:21 - error TS2694: Namespace 'React' has no exported member 'JSX'.

80     render(): React.JSX.Element;
                       ~~~


Found 8 errors in 3 files.

Errors  Files
     1  ../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/DropIndicator.d.ts:6
     1  ../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/Tree.d.ts:247
     6  ../../common/temp/node_modules/.pnpm/rc-tree@5.7.4_sfoxds7t5ydpegc3knd667wn6m/node_modules/rc-tree/lib/TreeNode.d.ts:73

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the TypeScript errors in an ESM package that indirectly uses rc-tree, then inspect the reported declarations in lib/DropIndicator.d.ts, lib/Tree.d.ts, and lib/TreeNode.d.ts. The work is done when the affected type declarations no longer produce the reported React.JSX errors in that setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.