Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -4944,7 +4944,7 @@ function preinitStyle(
(link: any)._p = new Promise((resolve, reject) => {
link.onload = resolve;
link.onerror = reject;
});
}).catch(() => {});
link.addEventListener('load', () => {
state.loading |= Loaded;
});
Expand Down Expand Up @@ -5467,7 +5467,7 @@ export function acquireResource(
(linkInstance: any)._p = new Promise((resolve, reject) => {
linkInstance.onload = resolve;
linkInstance.onerror = reject;
});
}).catch(() => {});
setInitialProperties(instance, 'link', stylesheetProps);
resource.state.loading |= Inserted;
insertStylesheet(instance, qualifiedProps.precedence, hoistableRoot);
Expand Down Expand Up @@ -6170,7 +6170,7 @@ export function suspendResource(
(linkInstance: any)._p = new Promise((resolve, reject) => {
linkInstance.onload = resolve;
linkInstance.onerror = reject;
});
}).catch(() => {});
setInitialProperties(instance, 'link', stylesheetProps);
resource.instance = instance;
}
Expand Down
6 changes: 2 additions & 4 deletions packages/react-dom/src/__tests__/ReactDOMFloat-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3082,9 +3082,7 @@ body {
);
});

// eslint-disable-next-line jest/no-disabled-tests
it.skip('can delay commit until css resources error', async () => {
// TODO: This test fails and crashes jest. need to figure out why before unskipping.
it('can delay commit until css resources error', async () => {
const root = ReactDOMClient.createRoot(container);
expect(getMeaningfulChildren(container)).toBe(undefined);
React.startTransition(() => {
Expand Down Expand Up @@ -3119,7 +3117,7 @@ body {
errorStylesheets(['bar']);

loadStylesheets(['foo']);
assertLog(['load stylesheet: foo', 'error stylesheet: bar']);
assertLog(['error stylesheet: bar', 'load stylesheet: foo']);

// We expect that the commit finishes synchronously after the stylesheet loads.
expect(getMeaningfulChildren(container)).toEqual(<div>hello</div>);
Expand Down