Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript support for react-redux selector and dispatch #6716

Merged
merged 5 commits into from
Jan 26, 2025

Conversation

royallsilwallz
Copy link
Contributor

What type of PR is this?

  • πŸ§‘β€πŸ’» Refactor

Describe this PR

The code changes in the PR will remove the requirement to specify type for redux state in each selector.
This results in better typescript code.

Changes

  • Setup Typescript support for useSelector & useDispatch hooks
  • Configure import path aliases for folders

@royallsilwallz royallsilwallz force-pushed the fix/typescript-vite-issues branch from 39360c7 to 9c67ff8 Compare January 25, 2025 20:07
Copy link
Collaborator

@JoltCode JoltCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! - Just one thing, perhaps we should use a vite plugin instead of declaring the paths manually to ensure our paths are a single point of truth?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the vite config comment (Can we use https://www.npmjs.com/package/vite-tsconfig-paths instead?)

@royallsilwallz
Copy link
Contributor Author

Can we use https://www.npmjs.com/package/vite-tsconfig-paths instead?

Yes, sure! I didn't know of this.. I'll do it. Thanks! πŸš€

@royallsilwallz royallsilwallz force-pushed the fix/typescript-vite-issues branch from 4ae9a0e to eb6eac5 Compare January 26, 2025 05:06
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jan 26, 2025
Copy link
Collaborator

@JoltCode JoltCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work πŸ‘

@royallsilwallz royallsilwallz merged commit a54c29f into typescript-vite Jan 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file scope: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants