make cellId optional

This commit is contained in:
sunilyadav840 2021-05-21 14:31:45 +05:30
parent 1e0a0b73e0
commit 1e32838f60
2 changed files with 3 additions and 3 deletions

View File

@ -54,11 +54,11 @@ export const SET_HOVERED_CELL = "SET_HOVERED_CELL";
export interface SetHoveredCellAction {
type: "SET_HOVERED_CELL";
payload: {
cellId: CellId;
cellId?: CellId;
};
}
export const setHoveredCell = (payload: { cellId: CellId }): SetHoveredCellAction => {
export const setHoveredCell = (payload: { cellId?: CellId }): SetHoveredCellAction => {
return {
type: SET_HOVERED_CELL,
payload,

View File

@ -30,7 +30,7 @@ class HoverableCell extends React.Component<ComponentProps & DispatchProps> {
const mapDispatchToProps = (dispatch: Dispatch, { id }: { id: string }): DispatchProps => ({
hover: () => dispatch(actions.setHoveredCell({ cellId: id })),
unHover: () => dispatch(actions.setHoveredCell({ cellId: "" })),
unHover: () => dispatch(actions.setHoveredCell({ cellId: undefined })),
});
export default connect(undefined, mapDispatchToProps)(HoverableCell);