GithubHelp home page GithubHelp logo

incode-app's People

Contributors

evgenbabenko avatar

Watchers

 avatar

incode-app's Issues

Binding

https://github.com/EvgenBabenko/incode-app/blob/f/async/src/containers/Auth.jsx#L10

Please take a look at binding strategies in React and their pros/cons.
Take thoughtfully this article https://medium.com/@charpeni/arrow-functions-in-class-properties-might-not-be-as-great-as-we-think-3b3551c440b1

Summary:

The initialization of arrow functions in class properties are transpiled into the constructor.
Arrow functions in class properties won’t be in the prototype and we can’t call them with super.
Arrow functions in class properties are much slower than bound functions, and both are much slower than usual function.

avoid componentDidUpdate as much as possible

componentDidUpdate(prevProps) {

Try to avoid componentDidUpdate as much as possible. Use it only in case you need to do something after EVERY component rerender (DOM has been updated): for example you're using any 3rd-party UI libs like charts, maps or whatever.
There is a recommendation to use it in case you need some actions to perform if props have been changed, but it's also dangerous bc you may come into an infinite loop by occasional using setState somewhere inside.
Please take a look at getDerivedStateFromProps approach https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops AND read about it thoughtfully (including warnings and better alternatives).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.