DEV Community

loading...
Cover image for Three common mistakes when you are working with react context API

Three common mistakes when you are working with react context API

aman2221 profile image Aman Singh Updated on ・1 min read

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.

Discussion (0)

pic
Editor guide