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

209
Views
I get this error. Unhandled Runtime Error Error: Element type is invalid: expected a string (for built-in components)

I created a store with a register/signin page and I got a dispatch error that says I imported or exported the dispatch wrong. I tried fixing it the import but I still can fix the problem.

import axios from 'axios';
import { Store } from '../utils/Store';

  const { state, dispatch } = useContext(Store);
  const { userInfo } = state;

  const submitHandler = async ({ name, email, password, confirmPassword }) => {
    closeSnackbar();
    if (password !== confirmPassword) {
      enqueueSnackbar("Passwords don't match", { variant: 'error' });
      return;
    }
    try {
      const { data } = await axios.post('/api/users/register', {
        name,
        email,
        password,
      });
      console.log(data)

      dispatch({ type: 'USER_LOGIN', payload: data });
      console.log(dispatch())
  };

The dispatch give me the above error and I do not know how to solve it.

about 4 years ago · Juan Pablo Isaza
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!