8 Matching Annotations
  1. Last 7 days
    1. The best place to initialize a FormValidation instance is inside the component's onMount event:

      Why? Presumably because it needs access to a form element (document.getElementById('loginForm'))...

  2. Oct 2020
  3. Sep 2020
    1. With useEffect, you can handle lifecycle events directly inside function components. Namely, three of them: componentDidMount, componentDidUpdate, and componentWillUnmount. All with one function!
  4. Aug 2020
    1. It's recommended to put the fetch in onMount rather than at the top level of the <script> because of server-side rendering (SSR). With the exception of onDestroy, lifecycle functions don't run during SSR, which means we can avoid fetching data that should be loaded lazily once the component has been mounted in the DOM.