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: change devtools env condition #3468

Closed
wants to merge 1 commit into from

Conversation

dngwoodo
Copy link

@dngwoodo dngwoodo commented Apr 4, 2022

We basically use process.env.NODE_ENV as 'localhost', so devtools does not work.

So I changed the devtools conditional statement. Please check it out.

change conditions for non-development cases
@vercel
Copy link

vercel bot commented Apr 4, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tanstack/react-query/3pUBokQxnTNmxkAjggYjU62gtnVo
✅ Preview: https://react-query-git-fork-dngwoodo-devtools-env-condition-tanstack.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 4, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e5df7da:

Sandbox Source
tannerlinsley/react-query: basic Configuration
tannerlinsley/react-query: basic-typescript Configuration

@TkDodo
Copy link
Collaborator

TkDodo commented Apr 4, 2022

this will also add devtools to testing environments where people might not expect it. or, if someone is building their production app with a special NODE_ENV, the devtools will not be split.

if you don't use DEVELOPMENT as NODE_ENV, you can also import the Devtools directly:

import { ReactQueryDevtools } from 'react-query/devtools/development'

@TkDodo TkDodo closed this Apr 4, 2022
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.

None yet

2 participants