Skip to content

Conversation

@abacaphiliac
Copy link

fix: throws helpful error instead of trying to call Array.prototype.filter on undefined

instead of providing a sensible fallback value (e.g., empty array []) i thought it would be more helpful to throw an error like you'd see if you try to use a <Link> without a <Router>:

    Error: Uncaught [Error: Invariant failed: You should not use <Link> outside a <Router>]

@masudiiuc
Copy link

masudiiuc commented Jan 18, 2022

@abacaphiliac I am having the following error with my jest test

TypeError: Cannot read property 'filter' of undefined

      78 |
      79 |   it(" Test View component Render", () => {
    > 80 |     const { container } = render(<TestView />);
         |                           ^

My Files:

const { container } = render(<TestView />);

File for Provider in App Level:

<FlagsProvider value={flagsConfigValues}>
      <PageWrapper>
        <Layout
            content={LayoutContent}
        />
      </PageWrapper>
    </FlagsProvider>

Any Help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants