Skip to content

Commit

Permalink
fix: begin removing defaultprops
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Nov 27, 2023
1 parent 83b42a5 commit 0caf185
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/components/loginRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import Page from '@/app/login/page';
import { autoLogin } from '@/reducers/login';
import { State } from '@/types';
import Loader from './pageLoader';
import { Action } from "redux";

const LoginRouter = ({ children }: { children: ReactNode }) => {
const dispatch = useDispatch();
const state = useSelector((state: State) => state);

useEffect(() => {
dispatch(autoLogin());
dispatch(autoLogin() as unknown as Action);
}, []); // eslint-disable-line

if (!state.server.socketConnected) {
Expand Down
6 changes: 1 addition & 5 deletions src/components/pageLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';

import './pageLoader.scss';

const Loading = ({ children }: { children?: ReactNode }) => {
const Loading = ({ children = null }: { children?: ReactNode }) => {
return (
<div className="loading">
{children ? children : 'Chargement en cours...'}
Expand All @@ -15,8 +15,4 @@ const Loading = ({ children }: { children?: ReactNode }) => {
);
};

Loading.defaultProps = {
children: null,
};

export default Loading;

0 comments on commit 0caf185

Please sign in to comment.