-
Notifications
You must be signed in to change notification settings - Fork 2.2k
PanelStack2 migration
Adi Dahiya edited this page Feb 24, 2021
·
6 revisions
-
<PanelStack2>uses React hooks, so you must use React 16.8+, otherwise it will fail at runtime.@blueprintjs/core>=v3.39.0 <4.0.0 is lenient about its React peer dependency and will not enforce this constraint for you.
- The component type is now constrained by a generic type parameter. This change fixes issues like #4272.
- As a JavaScript user, this does not affect you.
- It is unlikely to require any changes for TypeScript consumers either, as the correct types will be inferred across the component API.
- Interface names have changed.
-
IPanel->Panel -
IPanelProps->PanelActions
-
- The
Panel<T>interface has changed to use a slightly more standard "render prop" pattern:
import { Panel, PanelActions } from "@blueprintjs/core";
interface PanelExampleProps {
...
}
const PanelExample: React.FC<PanelExampleProps & PanelActions<PanelExampleProps> = props => {
...
};
const initialPanel: Panel<PanelExampleProps>> = {
props: {
panelNumber: 1,
},
- component: PanelExample,
+ renderPanel: PanelExample,
+ // or, if it was a class component:
+ renderPanel: p => <PanelExample {...p} />,
title: "Panel 1",
};- FAQ
- 6.x Changelog
- 5.x Changelog
- 5.0 pre-release changelog
- 4.x Changelog
- v4.0 & v5.0 major version semantic swap
- v6.0 changes
- Spacing System Migration: 10px to 4px
- react-day-picker v8 migration
- HotkeysTarget & useHotkeys migration
- PanelStack2 migration
- Table 6.0 changes