@tanstack/react-query-devtools 5.0.0-alpha.27 → 5.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7818,7 +7818,7 @@ const getStyles = () => {
7818
7818
  background-color: ${colors.darkGray[400]};
7819
7819
  font-size: ${font.size.sm};
7820
7820
  color: ${colors.gray[500]};
7821
- z-index: 2;
7821
+ z-index: 7;
7822
7822
  `,
7823
7823
  settingsMenuHeader: css`
7824
7824
  padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
@@ -7877,7 +7877,7 @@ class TanstackQueryDevtools {
7877
7877
  initialIsOpen,
7878
7878
  errorTypes
7879
7879
  } = config;
7880
- this.client = client;
7880
+ this.client = createSignal(client);
7881
7881
  this.queryFlavor = queryFlavor;
7882
7882
  this.version = version;
7883
7883
  this.onlineManager = onlineManager;
@@ -7898,6 +7898,9 @@ class TanstackQueryDevtools {
7898
7898
  setErrorTypes(errorTypes) {
7899
7899
  this.errorTypes[1](errorTypes);
7900
7900
  }
7901
+ setClient(client) {
7902
+ this.client[1](client);
7903
+ }
7901
7904
  mount(el) {
7902
7905
  if (this.isMounted) {
7903
7906
  throw new Error('Devtools is already mounted');
@@ -7907,11 +7910,9 @@ class TanstackQueryDevtools {
7907
7910
  const [pos] = this.position;
7908
7911
  const [isOpen] = this.initialIsOpen;
7909
7912
  const [errors] = this.errorTypes;
7913
+ const [queryClient] = this.client;
7910
7914
  const _self$ = this;
7911
7915
  return createComponent(DevtoolsComponent, mergeProps({
7912
- get client() {
7913
- return _self$.client;
7914
- },
7915
7916
  get queryFlavor() {
7916
7917
  return _self$.queryFlavor;
7917
7918
  },
@@ -7922,6 +7923,9 @@ class TanstackQueryDevtools {
7922
7923
  return _self$.onlineManager;
7923
7924
  }
7924
7925
  }, {
7926
+ get client() {
7927
+ return queryClient();
7928
+ },
7925
7929
  get buttonPosition() {
7926
7930
  return btnPosition();
7927
7931
  },
@@ -7950,6 +7954,7 @@ class TanstackQueryDevtools {
7950
7954
 
7951
7955
  function ReactQueryDevtools$1(props) {
7952
7956
  const queryClient = reactQuery.useQueryClient();
7957
+ const client = props.client || queryClient;
7953
7958
  const ref = React.useRef(null);
7954
7959
  const {
7955
7960
  buttonPosition,
@@ -7958,7 +7963,7 @@ function ReactQueryDevtools$1(props) {
7958
7963
  errorTypes
7959
7964
  } = props;
7960
7965
  const [devtools] = React.useState(new TanstackQueryDevtools({
7961
- client: props.client || queryClient,
7966
+ client: client,
7962
7967
  queryFlavor: 'React Query',
7963
7968
  version: '5',
7964
7969
  onlineManager: reactQuery.onlineManager,
@@ -7967,6 +7972,9 @@ function ReactQueryDevtools$1(props) {
7967
7972
  initialIsOpen,
7968
7973
  errorTypes
7969
7974
  }));
7975
+ React.useEffect(() => {
7976
+ devtools.setClient(client);
7977
+ }, [client, devtools]);
7970
7978
  React.useEffect(() => {
7971
7979
  if (buttonPosition) {
7972
7980
  devtools.setButtonPosition(buttonPosition);