I tried to integrate the following code, which is the latest one from the docs, into a react custom component, but I got the following error:
Error:
ERROR
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
You might have mismatching versions of React and the renderer (such as React DOM)
You might be breaking the Rules of Hooks
You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
You might have mismatching versions of React and the renderer (such as React DOM)
Code:
import React, { Component } from 'react';
import Widget from 'rasa-webchat';
class CustomWidget extends Component {
render() {
return (
<Widget
initPayload={"/get_started"}
socketUrl={"http://localhost:5005"}
socketPath={"/socket.io/"}
customData={{"language": "en"}} // arbitrary custom data. Stay minimal as this will be added to the socket
title={"Title"}
/>
);
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I tried to integrate the following code, which is the latest one from the docs, into a react custom component, but I got the following error:
Error: ERROR Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
Code: import React, { Component } from 'react'; import Widget from 'rasa-webchat';
class CustomWidget extends Component { render() { return ( <Widget initPayload={"/get_started"} socketUrl={"http://localhost:5005"} socketPath={"/socket.io/"} customData={{"language": "en"}} // arbitrary custom data. Stay minimal as this will be added to the socket title={"Title"} /> ); } }
export default CustomWidget;