Skip to content

Commit

Permalink
fix: currentMember type to js instead of Immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Aug 2, 2022
1 parent add0d6c commit 876d495
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/context/CurrentMemberContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import React, { FC, ReactElement } from 'react';

import { ImmutableMember } from '../types';

export const CurrentMemberContext = React.createContext(new ImmutableMember());
export type CurrentMemberContextType = {
id: string;
name: string;
type: string;
};

export type CurrentMemberContextType = ImmutableMember;
export const CurrentMemberContext = React.createContext({
id: '',
name: '',
type: '',
});

type Props = {
children: ReactElement | ReactElement[];
Expand All @@ -16,7 +24,9 @@ export const CurrentMemberContextProvider: FC<Props> = ({
currentMember,
}) => {
return (
<CurrentMemberContext.Provider value={currentMember}>
<CurrentMemberContext.Provider
value={currentMember.toJS() as CurrentMemberContextType}
>
{children}
</CurrentMemberContext.Provider>
);
Expand Down

0 comments on commit 876d495

Please sign in to comment.