Skip to content
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

Merged
merged 4 commits into from
Aug 12, 2024
Merged

fix: ts migrate #207

merged 4 commits into from
Aug 12, 2024

Conversation

Oleks-Y
Copy link
Collaborator

@Oleks-Y Oleks-Y commented Jul 21, 2024

No description provided.

@a-gubskiy a-gubskiy requested a review from niravzi July 21, 2024 18:07
src/containers/scheduleDayToggler/scheduleDayToggler.tsx Outdated Show resolved Hide resolved
src/common/constants/subjectTypes.ts Outdated Show resolved Hide resolved
src/common/context/groupContext.tsx Outdated Show resolved Hide resolved
@@ -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);
Copy link
Collaborator

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

Copy link
Collaborator

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>();

src/components/scheduleItemContent/scheduleItemContent.tsx Outdated Show resolved Hide resolved
src/components/switch/switch.tsx Show resolved Hide resolved
const ScheduleTypeTab = ({tabClick, activeTab, children, url}) => {
const ScheduleTypeTab = ({
tabClick,
activeTab,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

activeTab is not used

Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.ReactNode

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not fixed

src/components/scheduleTypeTab/scheduleTypeTab.tsx Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@niravzi niravzi merged commit 9491c28 into typescript-migration Aug 12, 2024
1 check passed
@niravzi niravzi deleted the fix/alex-ts-migration-fixes branch August 12, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants