palantir/blueprint
View on GitHubTypings on PanelStack2 are not working as explain in documentation
Open
#5359 opened on Jun 7, 2022
P1Package: coreType: bughelp wanted
Description
Environment
- Package version(s): core 4.4.1
- Operating System: MacOS Monterrey 12.3.1
- Browser name and version: Chrome Version 102.0.5005.61
Code Sandbox
(https://codesandbox.io/s/spring-sun-vomre1?file=/src/App.tsx)
Steps to reproduce
- Create a component and add a
PanelStack2 - Add a custom panel component with his own typing props (e.g: ComponentType) using
PanelProps<ComponentType> - Try adding this custom panel as initial panel
Actual behavior
You will face this type error: Type 'PanelProps' is not assignable to type 'PanelProps'.
Expected behavior
Types should be ok as it's following, the docs. I also think it should be ok to define Panel as :
type MainPanelProps = {
loading: boolean;
};
const MainPanel = (props: PanelProps<MainPanelProps>) => {
return <div />;
};
Possible solution
🤷♂️ Sorry, i have no idea.