Skip to content

Commit

Permalink
feat: Setup why-did-you-render
Browse files Browse the repository at this point in the history
Setup was removed by mistake during the split with cozy-drive.
  • Loading branch information
zatteo committed Dec 20, 2024
1 parent c284a8f commit 0f970a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/photos/targets/browser/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import 'cozy-sharing/dist/stylesheet.css'
import 'cozy-viewer/dist/stylesheet.css'
import 'photos/styles/main.styl'

// Uncomment to activate why-did-you-render
// https://github.com/welldone-software/why-did-you-render
// import './wdyr'

import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
Expand Down
8 changes: 8 additions & 0 deletions src/photos/targets/browser/wdyr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react'

if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render')
whyDidYouRender(React, {
trackAllPureComponents: true
})
}

0 comments on commit 0f970a6

Please sign in to comment.