add onGroupChange function parameter (can be null)
This commit is contained in:
parent
c21e4785ce
commit
a735ee8304
@ -13,13 +13,17 @@ import React from "react";
|
|||||||
interface Props {
|
interface Props {
|
||||||
group: string;
|
group: string;
|
||||||
setGroup: (group: string) => void;
|
setGroup: (group: string) => void;
|
||||||
|
onGroupChange: (() => void) | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const groups = ["Favorites", "Team"];
|
const groups = ["Favorites", "Team"];
|
||||||
|
|
||||||
const GroupSelect: React.FC<Props> = ({ group, setGroup }) => {
|
const GroupSelect: React.FC<Props> = ({ group, setGroup, onGroupChange }) => {
|
||||||
const handleChange = (e: SelectChangeEvent) => {
|
const handleChange = (e: SelectChangeEvent) => {
|
||||||
setGroup(e.target.value);
|
setGroup(e.target.value);
|
||||||
|
if (onGroupChange) {
|
||||||
|
onGroupChange();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user