'Invariant violation' error when used with Route.render and hooks
Hi, React hooks throws 'Invariant violation' error when used with Route.render method. I was trying to implement small custom hooks in my existing application and realised
render={Foo} throws exception
render={() =>
I'm not sure if this is a bug or expected behaviour. But if it's not a bug, it might be good idea to create a rule in eslint react hooks.
Versions: "react": "16.7.0-alpha.0 - next", "react-dom": "16.7.0-alpha.0 - next", "react-router-dom": "4.4.0-beta.6", "react-scripts": "2.1.1"
Testcase modified from a blogpost: https://codesandbox.io/s/40pzmw4w8w
See App.js AppWithRouter component
render={Foo} isn't correct. It should be a plain function, not a component.