diff --git a/.changeset/yellow-kings-cut.md b/.changeset/yellow-kings-cut.md new file mode 100644 index 000000000..e8b044276 --- /dev/null +++ b/.changeset/yellow-kings-cut.md @@ -0,0 +1,5 @@ +--- +"@itwin/presentation-hierarchies-react": patch +--- + +`TreeActionBase`: Made the `onClick` prop optional. diff --git a/packages/hierarchies-react/api/presentation-hierarchies-react-extract.api.md b/packages/hierarchies-react/api/presentation-hierarchies-react-extract.api.md index 7e55b7ed3..a8196daa0 100644 --- a/packages/hierarchies-react/api/presentation-hierarchies-react-extract.api.md +++ b/packages/hierarchies-react/api/presentation-hierarchies-react-extract.api.md @@ -224,7 +224,7 @@ export interface TreeActionBaseAttributes { // @alpha (undocumented) type TreeActionBaseProps = Omit, "onClick"> & TreeActionBaseAttributes & { - onClick: () => void; + onClick?: () => void; }; // @alpha diff --git a/packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/TreeAction.tsx b/packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/TreeAction.tsx index 913ae4d75..f86e8ae42 100644 --- a/packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/TreeAction.tsx +++ b/packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/TreeAction.tsx @@ -35,7 +35,7 @@ export interface TreeActionBaseAttributes { export type TreeActionBaseProps = Omit, "onClick"> & TreeActionBaseAttributes & { /** Callback invoked when the action is clicked. */ - onClick: () => void; + onClick?: () => void; }; /**