coatue-oss / react2angular

The easiest way to embed React components in Angular 1 apps.
Other
546 stars 109 forks source link

React hooks #112

Open brianHolonis opened 5 years ago

brianHolonis commented 5 years ago

If I use React hooks with a React.useState is this package expected to work with that?

Thank you.

captrespect commented 4 years ago

It works with hooks.

celtic7716 commented 4 years ago

@bcherny is this answer correct? I'm getting the mismatched component error even though my functional component with hooks is not a child of any class components:

Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component
nickvallee commented 3 years ago

I am also receiving the error above when trying to use hooks.

I am using them within a functional component in the same way that I use them in a none react2angular React component, and that is working fine.

gmoura commented 2 years ago

I am also receiving the error above when trying to use hooks.

elpddev commented 2 years ago

We are using react inside angularjs for now without a problem. Including functional components. Not sure what we did back then when we received the error but it works now.

function TopLevelReact