-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ts migrate #207
fix: ts migrate #207
Conversation
src/common/context/groupContext.tsx
Outdated
@@ -15,7 +15,7 @@ const GroupContext = createContext<GroupContextType | null>( null); | |||
export const useGroupContext = () => useContext(GroupContext); | |||
|
|||
export const GroupContextProvider: React.FC<Props> = ({ initialValue = null, children }) => { | |||
const [group, setGroup] = useState(initialValue); | |||
const [group, setGroup] = useState<string | null>(initialValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setGroup
here mismatches type of setGroup
of GroupContextType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fixed. Either define type for group
in GroupContextType
or leave it as any
, but specify correct type in useState
(now it's string, but group
is an object):
Option 1:
interface Group {
id: string;
name: string;
}
// ...
interface GroupContextType {
group?: Group;
setGroup: React.Dispatch<Group>;
};
// ...
const [group, setGroup] = useState<Group>();
Option 2:
interface GroupContextType {
group?: any;
setGroup: React.Dispatch<any>;
};
// ...
const [group, setGroup] = useState<any>();
const ScheduleTypeTab = ({tabClick, activeTab, children, url}) => { | ||
const ScheduleTypeTab = ({ | ||
tabClick, | ||
activeTab, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activeTab is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fixed
}: { | ||
tabClick?: any; | ||
activeTab?: any; | ||
children: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React.ReactNode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fixed
No description provided.