-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Use SubscriptionManager to migrate List components to providers.
- Right now, when we create a List Component we are writing somethig like:
interface Props {
trainingList: TrainingSummary[];
fetchTrainings: (studentId: number) => void;
}
export class TrainingListPage extends React.Component<Props, {}> {
public componentDidMount() {
this.props.fetchTrainings(this.props.studentId);
}
public render() {
return (
<div>
...
</div>
);
}
}- The idea is to use
src/common/components/subscriptionManagercomponent to avoid use componentDidMount in this Presentational component.
Steps:
-
Create a fork.
-
Create new branch called feature/<issue_number>_Migrate to List Providers components (where issue_number is the id of this issue given by Github).
-
You can see how this kind of Provider component is implemented in
src/pages/trainer/training/list/trainingListProvider.tsx -
Migrate to provider component all list components from Admin, Trainer and Student modules.
-
Important: Follow this work flow