Skip to content

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Oct 12, 2025

JSX PPX: Use React.component<'a> instead of React.componentLike<'a, React.element> for external definitions with @react.component.

(At the moment, these are still equivalent, but I still hope to eventually be able to make React component an abstract type.)

Copy link

pkg-pr-new bot commented Oct 12, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7952

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7952

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7952

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7952

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7952

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7952

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7952

commit: 171c68a

@cknitt cknitt requested a review from zth October 12, 2025 10:27
@cknitt
Copy link
Member Author

cknitt commented Oct 13, 2025

Eventually we could even get rid of the Jsx.componentLike/ React.componentLike definition. I don't quite see the point of it.

@@ -1,5 +1,5 @@
Hover src/Jsx2.resi 1:4
{"contents": {"kind": "markdown", "value": "```rescript\nReact.element\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}}
{"contents": {"kind": "markdown", "value": "```rescript\nprops<string>\n```\n\n---\n\n```\n \n```\n```rescript\ntype props<'first> = {first: 'first}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.resi%22%2C0%2C0%5D)\n"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any comments on this change @cknitt ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why this happens, but now it's back to where it was before #7939, see also the comment there: #7939 (comment)

Copy link
Member

@zth zth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 1 small comment. Great stuff!

@cknitt cknitt merged commit 72750a9 into rescript-lang:master Oct 13, 2025
25 checks passed
@cknitt cknitt deleted the jsx-ppx-component branch October 13, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants