react-hybrid icon indicating copy to clipboard operation
react-hybrid copied to clipboard

UIRouter, <View> errors when setting up react-hybrid

Open crcommons opened this issue 6 years ago • 2 comments

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.

crcommons avatar May 08 '18 23:05 crcommons

Experiencing exactly the same error message when looking to upgrade from v0.1.0 to v0.2.0

billycrid avatar May 09 '18 14:05 billycrid

same here. the "component appears to have a render method" goes away when downgrading to 0.1

agos avatar May 16 '18 15:05 agos