Jo Micheal
Published in : 2022-03-13
I am facing this error when I try to run my Reactjs Component, I reviewed my code a lot of times but I cannot see any reason why this error is happening? the error is
TypeError: Super expression must either be null or a function
my component is
import React from 'react';import Page from 'src/components/Page';import { Container, Box, withStyles} from '@material-ui/core';import Header from './Header';import { withRouter } from 'react-router';const style = (() => ({ root:{ } }));class BanksList extends React.component { render(){ return ( <Page title="Banks"> <Container maxWidth="lg"> <Header /> </Container> </Page> ); }}export default withStyles(style)(withRouter(BanksList));
any thoughts?
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Mohamed Atef Date : 2022-03-13
Best answers
51
Best answers
51
Hello Jo,
This error happens because you have a mistake in the typo of the component in the line of
it should be Component with capital C
this gonna work with you, Good luck
Jo Micheal Date : 2022-03-13
Thanks, this was a mistake :)