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

177
Views
React.Suspense expected string after update

A recent update caused my React.Suspense fallback to throw this error:

Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

This exact code used to work and I'm wondering if anyone has any thoughts on which package to roll back(?)

// App.jsx

<Suspense fallback={<Fallback/>}>...</Suspense>

Here's my Fallback component:

import Loader from 'react-loader-spinner';
import React from 'react';

export const MediaUploading = ({
  t = 'Grid',
  c = '#121d66',
  h = '60',
  w = '60',
}) => {
  return (
    <div className="media-uploading">
      <Loader type={t} color={c} height={h} width={w} timeout={0} />
    </div>
  );
};

// fallback
export const Fallback = ({
  t = 'Grid',
  c = '#121d66',
  h = '100',
  w = '100',
}) => {
  return (
    <div className="loading">
      <Loader type={t} color={c} height={h} width={w} timeout={0} />
    </div>
  );
};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Looks like when react-loader-spinner moved to v5, they dropped their Loader component and removed the default export. So if you want to keep using the Loader, then stick to react-spinner-loader@4.

v4 - only has a default export (no named exports)

import Loader from "react-loader-spinner";

v5 - only has named exports (no default export)

import { Grid } from "react-loader-spinner";

enter image description here

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!