Skip to content

Commit

Permalink
fix(query-core) export Mutation class instead of exporting it as a ty…
Browse files Browse the repository at this point in the history
…pe (#7793)

* fix(query-core) export Mutation class instead of exporting it as a type

previously, attempting to create a Mutation in a vanilla JS project required the use of the Mutation class constructor but due to it being exported as a type, we run into a runtime error stating that the Mutation type is not a class resulting in us not being able to proceed despite the compilation process in TypeScript not throwing an issue. This change exposes the class instead of the type in order to accomodate this requirement in vanilla JS projects

fixes `Mutation` class isn't exposed from @tanstack/query-core #7785

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
  • Loading branch information
3 people committed Jul 26, 2024
1 parent fec324f commit cd68280
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/query-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export {
export * from './types'
export type { QueryState } from './query'
export { Query } from './query'
export type { Mutation, MutationState } from './mutation'
export type { MutationState } from './mutation'
export { Mutation } from './mutation'
export type {
DehydrateOptions,
DehydratedState,
Expand Down

0 comments on commit cd68280

Please sign in to comment.