Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of null (reading 'useRef') #82

Closed
jessemoe opened this issue Jul 27, 2023 · 0 comments
Closed

Cannot read properties of null (reading 'useRef') #82

jessemoe opened this issue Jul 27, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jessemoe
Copy link

jessemoe commented Jul 27, 2023

Describe the bug

Uncaught TypeError: Cannot read properties of null (reading 'useRef')
    at Object.useRef (react.development.js:1628:1)
    at LiveChatWidget (widget-react.esm.js:284:1)
    at renderWithHooks (mf-va_remoteEntry.js:32482:28)
    at mountIndeterminateComponent (mf-va_remoteEntry.js:35795:23)
    at beginWork (mf-va_remoteEntry.js:36774:24)
    at beginWork$1 (mf-va_remoteEntry.js:40119:24)
    at performUnitOfWork (mf-va_remoteEntry.js:39567:23)
    at workLoopSync (mf-va_remoteEntry.js:39506:15)
    at renderRootSync (mf-va_remoteEntry.js:39485:17)
    at recoverFromConcurrentError (mf-va_remoteEntry.js:39105:30)
    at performConcurrentWorkOnRoot (mf-va_remoteEntry.js:39053:32)
    at workLoop (mf-va_remoteEntry.js:20594:44)
    at flushWork (mf-va_remoteEntry.js:20573:24)
    at MessagePort.performWorkUntilDeadline (mf-va_remoteEntry.js:20781:31)

To Reproduce
node version: 20.4.0
react version: 18.0.1

function LiveChatWidget(props) {
  var widgetRef = React.useRef(null);
  React.useEffect(function () {
    widgetRef.current = createWidget(props);
    window.__lc.integration_name = "@livechat/widget-react";
    widgetRef.current.init();
    return function () {
      var _widgetRef$current;

      (_widgetRef$current = widgetRef.current) === null || _widgetRef$current === void 0 ? void 0 : _widgetRef$current.destroy();
    }; // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [props.license, props.group, props.chatBetweenGroups]);

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@jessemoe jessemoe added the bug Something isn't working label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants