GroceriStar / showcase

Simple page with Grocery List cards
https://boring-benz-76e55f.netlify.com/
GNU General Public License v3.0
1 stars 5 forks source link

slow loading #140

Closed atherdon closed 5 years ago

atherdon commented 5 years ago

https://desmart.com/blog/react-is-slow-oh-wait-tips-on-how-to-optimize-react-apps-performance-1 https://hackernoon.com/improving-first-time-load-of-a-production-react-app-part-1-of-2-e7494a7c7ab0 https://medium.com/myheritage-engineering/how-to-greatly-improve-your-react-app-performance-e70f7cbbb5f6 https://marmelab.com/blog/2017/02/06/react-is-slow-react-is-fast.html

vadim9999 commented 5 years ago

I tried this method in component Cell

shouldComponentUpdate(nextProps, nextState) {
  if (this.props.name !== nextProps.name) {
    console.log("Name **********************");
        return true;
    }

      console.log("False ****************************");
      return false;
    }

After this when I open a tile it's empty also I have installed "why-did-you-update" that display re-render components when loading home it`s ~ 451 re-render when open a tile ~ 1117 PureComponent doesn't work

atherdon commented 5 years ago

wow thisi our candidate!

vadim9999 commented 5 years ago

ok, it's working PureComponent and shouldComponentUpdate() I just needed more learn

atherdon commented 5 years ago

cool! optimization is an important thing - i like that you learning it also, you can apply your debug to this samples: https://codesandbox.io/embed/0582jolnl https://codesandbox.io/embed/z6ly40071p

i just want to eliminate the possibility that this is an issue, related to package that we're using - because if this is their issue - we can not only solve our trouble - but also contribute to other project

atherdon commented 5 years ago

did we solve this issue, right? at my side - it works better

vadim9999 commented 5 years ago

yes