Skip to content

chore(Page): update content PropTypes to reflect supported types#8008

Merged
alexander-akait merged 3 commits intowebpack:mainfrom
mr-baraiya:update-content-proptypes
Mar 14, 2026
Merged

chore(Page): update content PropTypes to reflect supported types#8008
alexander-akait merged 3 commits intowebpack:mainfrom
mr-baraiya:update-content-proptypes

Conversation

@mr-baraiya
Copy link
Copy Markdown
Contributor

Update content PropTypes to reflect the supported content types.

The component accepts content as a string, function, or Promise-like object, but the previous PropTypes only supported a Promise shape.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Mar 14, 2026 1:18pm

Request Review

Copy link
Copy Markdown
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Can you point me where we use string/function?

Also default SHOULD NOT BE ANY

@mr-baraiya
Copy link
Copy Markdown
Contributor Author

content can be passed as a string or function through MDX rendering in the docs.
For example, MDX pages may pass content as a string or a render function depending on how the page is compiled.
I updated the PropTypes to explicitly reflect these supported types instead of the previous Promise-only shape.

If needed, I can adjust the PropTypes further to remove any and make them stricter.

@alexander-akait
Copy link
Copy Markdown
Member

If needed, I can adjust the PropTypes further to remove any and make them stricter.

Yes, let's make it stricter

@mr-baraiya
Copy link
Copy Markdown
Contributor Author

Updated the PropTypes to remove any and make the content type stricter.

then: PropTypes.func.isRequired,
default: PropTypes.string,
then: PropTypes.func,
default: PropTypes.func,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it can be string or function and then is required for shape

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the PropTypes so content can be string, function, or Promise-like and made then required in the shape.

@alexander-akait alexander-akait merged commit f43978e into webpack:main Mar 14, 2026
9 checks passed
@mr-baraiya mr-baraiya deleted the update-content-proptypes branch March 14, 2026 14:02
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