Skip to content

refactor(router): use definite assignment assertions in createDeferred - #15396

Open
syedsohailhussain1 wants to merge 2 commits into
remix-run:mainfrom
syedsohailhussain1:refactor-deferred-types
Open

refactor(router): use definite assignment assertions in createDeferred#15396
syedsohailhussain1 wants to merge 2 commits into
remix-run:mainfrom
syedsohailhussain1:refactor-deferred-types

Conversation

@syedsohailhussain1

Copy link
Copy Markdown

Refactors createDeferred to use definite assignment assertions (!) for resolve and reject, completely eliminating the need for @ts-ignore comments.
Because the Promise executor runs synchronously, resolve and reject are guaranteed to be assigned before they are returned. Using ! explicitly communicates this guarantee to the TypeScript compiler in a type-safe way.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ CLA Signature Required

Hi @syedsohailhussain1, thanks for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your GitHub username to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request and the CI check will pass.

Thanks!

- The Remix team

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ No Change File Found

This PR doesn't include a change file which is used for automated release notes.
If your change affects users, please add one (or more) change files and commit the generated file(s).

pnpm run changes:add

This script requires Node 24+. If you are on a lower version, please add a file manually

Not every PR needs a change file — you can skip this step if the change is internal-only
(tests, tooling, docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant