React: TypeError: nextDeps.join is not a function

Created on 5 Mar 2019  路  3Comments  路  Source: facebook/react

I am getting this error while using hooks.
image

This is related code.

const market = useContext(MarketContext);
useEffect(() => {

  nav.items[1] = {
                 name: 'Market',
                url: '/market',
                icon: 'icon-speedometer',
                badge: {
                       variant: market == "Live" ? "primary" : "secondary",
                text: market,
           }
  };

}, market)

Most helpful comment

You probably meant to pass [market] rather than market as useEffect argument.

All 3 comments

Can you provide a codesandbox sample instead?

You probably meant to pass [market] rather than market as useEffect argument.

I'll close but I'm sending https://github.com/facebook/react/pull/15018 to add a warning for this.

Was this page helpful?
0 / 5 - 0 ratings