Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use generic type for vnode props in renderToReadableStream/renderToPipeableStream#409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JoviDeCroock merged 2 commits intopreactjs:mainfromf0x52:stream-types
Jan 10, 2025

Conversation

@f0x52
Copy link
Contributor

Currently thevnode argument for these two functions always defaults toVNode (which defaults toVNode<{}>), this causes issues withsome arguments that are otherwise valid (and run fine, it's purely a TypeScript typecheck issue).

constContext=createContext({});renderToPipeableStream(h(Context.Provider,{value:{}}),{});
/*src/index.ts:6:24 - error TS2345: Argument of type 'VNode<Attributes & { value: {}; children?: ComponentChildren; }>' is not assignable to parameter of type 'VNode<{}>'.  Types of property 'type' are incompatible.    Type 'string | ComponentType<Attributes & { value: {}; children?: ComponentChildren; }>' is not assignable to type 'string | ComponentType<{}>'.      Type 'ComponentClass<Attributes & { value: {}; children?: ComponentChildren; }, {}>' is not assignable to type 'string | ComponentType<{}>'.        Type 'ComponentClass<Attributes & { value: {}; children?: ComponentChildren; }, {}>' is not assignable to type 'ComponentClass<{}, {}>'.          Types of parameters 'props' and 'props' are incompatible.            Type '{}' is not assignable to type 'Attributes & { value: {}; children?: ComponentChildren; }'.              Property 'value' is missing in type '{}' but required in type '{ value: {}; children?: ComponentChildren; }'.6 renderToPipeableStream(h(Context.Provider, { value: {} }), {});                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  node_modules/preact/src/index.d.ts:383:3    383   value: T;          ~~~~~    'value' is declared here.

https://codesandbox.io/p/devbox/2tk3ws

Using the same fix as3dcf098 for these functions solves it

@changeset-bot
Copy link

changeset-botbot commentedJan 10, 2025
edited
Loading

🦋 Changeset detected

Latest commit:dd90281

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
preact-render-to-stringPatch

Not sure what this means?Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JoviDeCroock
Copy link
Member

Needs changeset

f0x52 reacted with thumbs up emoji

…peableStream, similar to other render functions
@JoviDeCroockJoviDeCroock merged commit2afaf31 intopreactjs:mainJan 10, 2025
1 check passed
@github-actionsgithub-actionsbot mentioned this pull requestJan 10, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JoviDeCroockJoviDeCroockJoviDeCroock approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@f0x52@JoviDeCroock

[8]ページ先頭

©2009-2025 Movatter.jp