Skip to content

Commit

Permalink
Revert "Revert "remove non-null-assertion""
Browse files Browse the repository at this point in the history
This reverts commit befb9c3.
  • Loading branch information
andrewHEguardian committed Jan 24, 2024
1 parent befb9c3 commit 7913a2e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/components/shared/SectionContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@ const divCss = (hasNav: boolean | undefined) => css`
}
`;

export const SelectedTopicObjectContext = createContext<
Dispatch<SetStateAction<string | undefined>>
>(undefined!); // eslint-disable-line @typescript-eslint/no-non-null-assertion -- // TODO: refactor this var to remove need for disabling eslint rule
const defaultDispatch = (_value: SetStateAction<string | undefined>) => {
return;
};

export const SelectedTopicObjectContext =
createContext<Dispatch<SetStateAction<string | undefined>>>(
defaultDispatch,
);

export const SectionContent = (props: SectionContentProps) => {
const [selectedTopicId, setSelectedTopicId] = useState<string | undefined>(
Expand Down

0 comments on commit 7913a2e

Please sign in to comment.