DEV Community

Cover image for Three common mistakes when you are working with react context API
Aman Singh
Aman Singh

Posted on • Edited on

Three common mistakes when you are working with react context API

These are the common reasons why react context API does not work properly :

  1. The best common and simplest reason is spelling mistakes. use this awesome VS Code extension: Code Spell Checker
  2. The wrong positioning of the parameter or arguments.

  3. While defining StateProvider function when you are using fat arrow function( () => () ) use parenthesis. because most of the time when we define a function we use Curly brackets { }.
    code
    This is my first post on the dev community.
    if there are any mistakes please let me know.

Thanks.

Top comments (0)