🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

reactotron-react-query

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactotron-react-query - npm Package Compare versions

Comparing version

to
1.0.1

6

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### 1.0.1 (2023-01-01)
- Update README.md
# Changelog

2

package.json
{
"name": "reactotron-react-query",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "build/main/index.js",

# Reactotron React Query for React Native
- Is there a plugin for Reactotron that allows for similar functionality to the React Query Devtools?
- Yes! This plugin helps you debug your React Query cache and queries in Reactotron.
![Screenshot](reactotron.png)
Is there a plugin for Reactotron that allows for similar functionality to the React Query Devtools? Yes! This plugin helps you debug your React Query cache and queries in Reactotron.
## Installation
```bash
npm i react-query
npm i reactotron-react-native --save-dev
npm i reactotron-react-query --save-dev
```
## Usage
Create a file queryClient.ts
```typescript
import { QueryClient } from "react-query";
const queryClient = new QueryClient();
export { queryClient };
```
Create a file reactotron.ts
```typescript
import Reactotron from "reactotron-react-native";
import { queryClient } from "./queryClient";
import {
QueryClientManager,
reactotronReactQuery,
} from "reactotron-react-query";
const queryClientManager = new QueryClientManager({
queryClient,
});
Reactotron.use(reactotronReactQuery(queryClientManager))
.configure({
onDisconnect: () => {
queryClientManager.unsubscribe();
},
})
.useReactNative()
.connect();
```
Import the queryClient and reactotron in your App.jsx file.
```jsx
import { StyleSheet, Text, View } from "react-native";
import { QueryClientProvider } from "react-query";
import { queryClient } from "./queryClient";
if (__DEV__) {
// @ts-ignore
import("./reactotron");
}
export default function App() {
return (
<QueryClientProvider client={queryClient}>
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
</View>
</QueryClientProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
```