Add type inference for redux's useSelector hook - Used module augmentation of TS to override the default root state interface - Replaced custom hook with redux's useSelector - It brings consistency as at a lot of places in the codebase we're using only the redux's useSelector
9 lines
293 B
TypeScript
9 lines
293 B
TypeScript
import "react-redux";
|
|
import { AppState } from "@appsmith/reducers";
|
|
|
|
declare module "react-redux" {
|
|
// We want the DefaultRootState interface to be the AppState interface
|
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
interface DefaultRootState extends AppState {}
|
|
}
|