[bpk-component-grid-toggle] Migrate to TypeScript#4758
[bpk-component-grid-toggle] Migrate to TypeScript#4758Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 5 commits into
Conversation
Migrates bpk-component-grid-toggle from JavaScript to TypeScript as described in #4745. - Replaced prop-types with TypeScript interfaces - Converted defaultProps to ES6 destructure defaults - Renamed .js source/test/story files to .tsx/.ts - Removed Flow type annotations - Preserved Apache 2.0 license headers Closes #4745
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Migrates bpk-component-grid-toggle toward TypeScript by adding typed Storybook metadata and replacing prop-types with TS interfaces / typed event handlers in the component.
Changes:
- Adds Storybook
Meta/StoryObjtypings to the grid toggle stories. - Replaces
prop-typeswithBpkGridToggleProps/ state interfaces and typed handlers. - Introduces a click handler wrapper to adapt React click events to the existing toggle function.
Reviewed changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-component-grid-toggle/src/BpkGridToggle.stories.js | Adds Storybook TS typings for meta and the exported story. |
| packages/backpack-web/src/bpk-component-grid-toggle/src/BpkGridToggle.js | Replaces prop-types with TS interfaces and adds typed event handlers + optional chaining around DOM selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4758 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4758 to see this build running in a browser. |
Summary
bpk-component-grid-togglefrom JavaScript to TypeScriptprop-typeswith TypeScript interfacesdefaultPropsto ES6 destructure defaults.jssource/test/story files to.tsx/.tsCloses #4745