react-hybrid
react-hybrid copied to clipboard
UIRouter, <View> errors when setting up react-hybrid
I've attempted to set up react-hybrid in my Angular app while we migrate to React, following the Read.me and the example app. I'm using React 16.3.2, and it's unclear if it is compatible with the current version of react-hybrid or setup is wrong.
Setup looks something like this in app.js:
import { UI_ROUTER_REACT_HYBRID } from '@uirouter/react-hybrid';
angular.module('app', [ ... UI_ROUTER_REACT_HYBRID, ... ])
Then immediately get the following errors (edited for brevity, but I can post additional error information if necessary):
Warning: The <UIView /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change UIView to extend React.Component instead.
warning.js:33 Warning: Stateless function components cannot be given refs. Attempts to access this ref will fail.
Check the render method of 'ReactUIView'. in UIView (created by ReactUIView) in UIRouterContextComponent (created by ReactUIView) in ReactUIView
Warning: Failed prop type: The prop 'router' is marked as required in 'View', but its value is 'undefined'. in View in UIView (created by ReactUIView) in UIRouterContextComponent (created by ReactUIView) in ReactUIView
Uncaught Error: UIRouter instance is undefined. Did you forget to include the <UIRouter> as root component?
The above error occurred in the <View> component: in View in UIView (created by ReactUIView) in UIRouterContextComponent (created by ReactUIView) in ReactUIView
Consider adding an error boundary to your tree to customize error handling behavior.
Experiencing exactly the same error message when looking to upgrade from v0.1.0 to v0.2.0
same here. the "component appears to have a render method" goes away when downgrading to 0.1