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

fix: import react deps when tags have mutator #1614

Conversation

yoshi2no
Copy link
Contributor

@yoshi2no yoshi2no commented Sep 6, 2024

Status

READY

Description

close #1612

Current behavior: When output.override.mutator is set (i.ehasGlobalMutator is true), the React dependencies (like useCallback) are imported. However, in this issue(#1612), the mutator is set in output.override.tags.foo, and this case wasn't covered properly.

Update: I've now made sure that even when the mutator is set in output.override.tags.foo, the React dependencies will be imported as expected.

Related PRs

List related PRs against other branches:

branch PR
other_pr_production link
other_pr_master link

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

Outline the steps to test or reproduce the PR here.

1.Following the steps in this issue, set up the orval.config.ts file and provide api.yaml as the input. Then, check the output to confirm that useCallback is being imported.

@melloware
Copy link
Collaborator

Looks like tests are failing?

@melloware melloware added this to the 7.1.1 milestone Sep 7, 2024
@melloware melloware merged commit 47d3367 into orval-labs:master Sep 7, 2024
2 checks passed
@soartec-lab
Copy link
Member

@yoshi2no
Thanks for good PR 👍
if you can make another PR for test of tags.mutator like a bellow, more great. would you make it ?

https://github.com/orval-labs/orval/blob/master/tests/configs/react-query.config.ts#L83-L107

@yoshi2no
Copy link
Contributor Author

yoshi2no commented Sep 8, 2024

@soartec-lab

Thanks! I'll do that later.

@soartec-lab
Copy link
Member

wonderful. I'm looking forward to it 🙌

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.

useCallback not imported when a custom instance is used with tags.
4 participants