withViewModel
Callable
Type parameters
- TViewModel: BaseViewModel
Parameters
viewModelDeclaration: ViewModelDeclaration<TViewModel, ViewControllerContext<InferViewModelProps<TViewModel>>>
Controller declaration
Returns <TComponentProps>(ViewComponent: React.ComponentType<PropsWithChildren<TComponentProps>>) => InferHocComponent<TViewModel, TComponentProps>
Type parameters
- TComponentProps: { viewModel: TViewModel }
Parameters
ViewComponent: React.ComponentType<PropsWithChildren<TComponentProps>>
Returns InferHocComponent<TViewModel, TComponentProps>
Creates a higher-order React component that provides a view model for a given view component.