Skip to content

Commit 38d0dfd

Browse files
Fix ESLint no-promise-executor-return error in DelayedComponent
Use block statement in Promise executor to avoid implicit return of setTimeout's timer ID. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d03434d commit 38d0dfd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components/DelayedComponent.server.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export default async (props, _railsContext) => {
1515
const { delayMs = 1000 } = props;
1616

1717
// Simulate slow server-side data fetching
18-
await new Promise((resolve) => setTimeout(resolve, delayMs));
18+
await new Promise((resolve) => {
19+
setTimeout(resolve, delayMs);
20+
});
1921

2022
return () => <DelayedComponent {...props} />;
2123
};

0 commit comments

Comments
 (0)