
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
react-native-react-query-devtools
Advanced tools
React Query Dev Tools The same tool you know and love! Now available for React Native with enhanced features and modern UI!
To integrate React Query Dev Tools into your React Native project, follow these simple installation steps. Open your terminal, navigate to your project directory, and execute:
npm install react-native-react-query-devtools
This command adds the react-native-react-query-devtools package to your project dependencies, making the Dev Tools available for use.
Incorporating React Query Dev Tools into your application is straightforward. Begin by importing the DevToolsBubble component.
import { DevToolsBubble } from "react-native-react-query-devtools";
Next, integrate the DevToolsBubble component into your app. To enable object copying functionality, you must provide a custom copy function that works with your platform (Expo or React Native CLI).
function RootLayoutNav() {
const colorScheme = useColorScheme();
const queryClient = new QueryClient();
// Define your copy function based on your platform
const onCopy = async (text: string) => {
try {
// For Expo:
await Clipboard.setStringAsync(text);
// OR for React Native CLI:
// await Clipboard.setString(text);
return true;
} catch {
return false;
}
};
return (
<QueryClientProvider client={queryClient}>
<ThemeProvider value={colorScheme === "dark" ? DarkTheme : DefaultTheme}>
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
</Stack>
</ThemeProvider>
<DevToolsBubble onCopy={onCopy} queryClient={queryClient} />
</QueryClientProvider>
);
}
The onCopy
prop is required to enable copying functionality in the dev tools. This function should:
Example implementations:
For Expo:
import * as Clipboard from "expo-clipboard";
const onCopy = async (text: string) => {
try {
await Clipboard.setStringAsync(text);
return true;
} catch {
return false;
}
};
For React Native CLI:
import Clipboard from "@react-native-clipboard/clipboard";
const onCopy = async (text: string) => {
try {
await Clipboard.setString(text);
return true;
} catch {
return false;
}
};
The DevToolsBubble component accepts additional props for customization:
interface DevToolsBubbleProps {
queryClient: QueryClient; // Required: The QueryClient instance to use
onCopy: (text: string) => Promise<boolean>;
// Optional: Callback when selection state changes
onSelectionChange?: (hasSelection: boolean) => void;
// Optional: Custom pan responder for advanced gesture handling
panResponder?: PanResponderInstance;
}
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on GitHub.
FAQs
React Query Dev Tools for React Native
The npm package react-native-react-query-devtools receives a total of 9,065 weekly downloads. As such, react-native-react-query-devtools popularity was classified as popular.
We found that react-native-react-query-devtools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.