@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.
@@ -7816,7 +7816,7 @@ const getStyles = () => {
7816
7816
  background-color: ${colors.darkGray[400]};
7817
7817
  font-size: ${font.size.sm};
7818
7818
  color: ${colors.gray[500]};
7819
- z-index: 2;
7819
+ z-index: 7;
7820
7820
  `,
7821
7821
  settingsMenuHeader: css`
7822
7822
  padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
@@ -7875,7 +7875,7 @@ class TanstackQueryDevtools {
7875
7875
  initialIsOpen,
7876
7876
  errorTypes
7877
7877
  } = config;
7878
- this.client = client;
7878
+ this.client = createSignal(client);
7879
7879
  this.queryFlavor = queryFlavor;
7880
7880
  this.version = version;
7881
7881
  this.onlineManager = onlineManager;
@@ -7896,6 +7896,9 @@ class TanstackQueryDevtools {
7896
7896
  setErrorTypes(errorTypes) {
7897
7897
  this.errorTypes[1](errorTypes);
7898
7898
  }
7899
+ setClient(client) {
7900
+ this.client[1](client);
7901
+ }
7899
7902
  mount(el) {
7900
7903
  if (this.isMounted) {
7901
7904
  throw new Error('Devtools is already mounted');
@@ -7905,11 +7908,9 @@ class TanstackQueryDevtools {
7905
7908
  const [pos] = this.position;
7906
7909
  const [isOpen] = this.initialIsOpen;
7907
7910
  const [errors] = this.errorTypes;
7911
+ const [queryClient] = this.client;
7908
7912
  const _self$ = this;
7909
7913
  return createComponent(DevtoolsComponent, mergeProps({
7910
- get client() {
7911
- return _self$.client;
7912
- },
7913
7914
  get queryFlavor() {
7914
7915
  return _self$.queryFlavor;
7915
7916
  },
@@ -7920,6 +7921,9 @@ class TanstackQueryDevtools {
7920
7921
  return _self$.onlineManager;
7921
7922
  }
7922
7923
  }, {
7924
+ get client() {
7925
+ return queryClient();
7926
+ },
7923
7927
  get buttonPosition() {
7924
7928
  return btnPosition();
7925
7929
  },
@@ -7948,6 +7952,7 @@ class TanstackQueryDevtools {
7948
7952
 
7949
7953
  function ReactQueryDevtools$1(props) {
7950
7954
  const queryClient = useQueryClient();
7955
+ const client = props.client || queryClient;
7951
7956
  const ref = useRef(null);
7952
7957
  const {
7953
7958
  buttonPosition,
@@ -7956,7 +7961,7 @@ function ReactQueryDevtools$1(props) {
7956
7961
  errorTypes
7957
7962
  } = props;
7958
7963
  const [devtools] = useState(new TanstackQueryDevtools({
7959
- client: props.client || queryClient,
7964
+ client: client,
7960
7965
  queryFlavor: 'React Query',
7961
7966
  version: '5',
7962
7967
  onlineManager,
@@ -7965,6 +7970,9 @@ function ReactQueryDevtools$1(props) {
7965
7970
  initialIsOpen,
7966
7971
  errorTypes
7967
7972
  }));
7973
+ useEffect(() => {
7974
+ devtools.setClient(client);
7975
+ }, [client, devtools]);
7968
7976
  useEffect(() => {
7969
7977
  if (buttonPosition) {
7970
7978
  devtools.setButtonPosition(buttonPosition);