You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests fail with React 19 | Error: Uncaught [Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.] #1371
describe('When Loading component is rendered',()=>{it('Then it matches snapshot',()=>{const{ asFragment }=render(<Loading/>);expect(asFragment()).toMatchSnapshot();});});exportconstLoading=()=>{const{ t }=useTranslation();return(<divclassName={styles.loading}data-testid="loading"><LoadingImageclassName={styles.loadingImage}/><h1>{t('default-loading-text')}</h1><divclassName={styles.loadingHint}><LoadingSpinnerclassName={styles.loadingSpinner}/><h2>{t('photo-capture.loading-text')}</h2></div></div>);};
What you did:
Run the test with jest and get the error after updating to React 19.
What happened:
Get the error:
console.error Error: Uncaught [Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.]
Reproduction:
Problem description:
Suggested solution:
rjohnep, raualvron, MakotoUwaya and erlanbelekov-epam