connectIModelConnectionAndViewState Function
Deprecated in 4.15.0. Components should take iModel connection and view state as props.
Function that will connect a component to the IModelConnection data in the Redux store
connectIModelConnectionAndViewState(mapStateToProps?: any, mapDispatchToProps?: any): InferableComponentEnhancerWithProps<any, any>
@example
// connect component for both getting and setting ImodelConnection data from Redux store.
import { connectIModelConnection, sessionStateMapDispatchToProps, SessionStateActionsProps } from "@itwin/appui-react";
export interface ComponentProps extends SessionStateActionsProps {
myData: string;
}
export const ConnectControl = connectIModelConnection(null, sessionStateMapDispatchToProps)(ComponentClass);
// this then allows connected control to update the store using a call like shown below.
this.props.setNumItemsSelected(30);
Returns - InferableComponentEnhancerWithProps<any, any>
Defined in
Last Updated: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.