Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
Why is my express react application not loading?

Why is it so difficult to post on here, everything I type in the title is not accepted so sorry it does not make sense.

Hello everyone! I'm having this error

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

This only seems to happen after I imported material-ui. Im pretty stumped. Here is my code.

import {Container, AppBar, Typography, Grow, Grid} from '@material-ui/core'
import bandmate from './images/bandmate.jpeg'

const App = ()=> {

    

    return (
        <Container maxidth = 'lg'>
            <AppBar position = 'static' color = 'inherit'>
                <Typography varaint = "h2" align = 'center'>BandMate</Typography>
                <img src= {bandmate} alt = 'bandmate' height= '60'/>
            </AppBar>
        </Container>
    );
}

export default App;



The solutions I have run into seem to reference webpack, I am not using webpack so I'm not sure where to go with that. I followed the link above and ran this code as instructed and it returned false, meaning I have a duplicate react issue

window.React1 = require('react');

// Add this in your component file
require('react-dom');
window.React2 = require('react');
console.log(window.React1 === window.React2);```




I've seen some people say to try npm link but I cant seem to get that to work either. I ran ```npm link ../myProjectName/client/node_modules/react``` Im not even sure if I am using npm link correctly, but I just get a ton of errors. All of the posts seem to point to this, but I either don't understand what I'm doing or its not the correct solution. 

Thank you all in advance for your help, I have been struggling with this for 2 days now with no progress.

Also I'm not sure what is up with my formatting, I thought you open and close with ``` ``` but I guess not.
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After I posted this I just uninstalled all of my packages and reinstalled them and it fixed the problem.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!