react-feature-flags
react-feature-flags copied to clipboard
Error: Uncaught [TypeError: Cannot read property 'filter' of undefined]
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>]
@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?