Comments (9)
the same issue
react-native 0.72.4
from why-did-you-render.
for what that's worth, I have the same setup as you and getting logs. The only difference is that I migrated to :
import React from 'react';
if (___DEV___) {
const whyDidYouRender = require('@welldone-software/why-did-you-render')
whyDidYouRender(React, {
trackAllPureComponents: true,
})
}`
Before that, I had it deactivated for a while and refactored quite a lot of components and screens. When reactivated, I was having no logs, then tried that.
I'm now getting a log once in a while, not sure if my code improved THAT much everything or if something changed in React/RN that makes WDYR triggers less.
from why-did-you-render.
I’ve described the solution for react-native projects in this pull request #288
from why-did-you-render.
Hi @sergeylaptev I've followed the steps but still getting no logs .
babel.config.js
module.exports = {
presets: ['module:@react-native/babel-preset'],
env: {
development: {
plugins: [['@babel/plugin-transform-react-jsx', {runtime: 'classic'}]],
},
},
};
wdyr.ts
/// <reference types="@welldone-software/why-did-you-render" />
import React from 'react';
if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React, {
trackAllPureComponents: true,
logOnDifferentValues: true,
collapseGroups: true,
trackHooks: true,
});
}
App.tsx
import {Button, Text, View} from 'react-native';
import React, {useState} from 'react';
const App = () => {
const [count, setCount] = useState(0);
return (
<View>
<Text>{count}</Text>
<ChildComponent />
<Button title="Increment" onPress={() => setCount(count + 1)} />
</View>
);
};
const ChildComponent = React.memo(({data}: any) => {
return (
<View>
<Text>{data}</Text>
</View>
);
});
ChildComponent.whyDidYouRender = true;
export default App;
index.js
import './wdyr';
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
from why-did-you-render.
try collapseGroups: false
in settings
from why-did-you-render.
@SudoPlz I have tried this also but not working .
Please help here . @sergeylaptev @SudoPlz
from why-did-you-render.
@avisek123 I'm not sure why it's not working, I'm also just experimenting myself. I had luck with both that flag, and include: [/^.*YourComponentName$/],
from why-did-you-render.
The same issue. It's not working. Tried with react-native version 0.73.4
, tried setting include
and collapseGroups: false
from why-did-you-render.
I'm using react native 0.73.4 and my babel.config.js is is using module:@react-native/babel-preset
.
And I don't have logs.
from why-did-you-render.
Related Issues (20)
- dom npm
- wdyr not work in next13 (repo provided) HOT 2
- wdyr not work in next13 (repo provided)
- WDYR includes full lodash library with window._ override HOT 6
- Cannot get WDYR output from nextjs dynamically loaded component (e.g. for no-ssr use case) HOT 2
- Project still being actively maintained? HOT 2
- Multiple React roots
- why-did-you-render + React Query
- Missing `ownerDataMap` in `notifier`
- Partially Working with React 18 + NextJS 13
- "Support for defaultProps will be removed" error after setting include: [/./] option HOT 2
- Tracking custom hooks issue HOT 2
- WhyDidYouRender is not working in Storybook.js
- Property 'React' doesn't exist HOT 1
- react-refresh-webpack-plugin not updating component when wrapped with React.memo.
- `trackAllPureComponents: true` is not working
- Next.js example is missing
- Links from the Credits section are broken HOT 1
- wyd support to react 19 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from why-did-you-render.