Skip to content

Fix react hook console errors#2198

Merged
mgamis-msft merged 4 commits intomainfrom
mgamis/fix-react-hook-console-errors
Aug 11, 2022
Merged

Fix react hook console errors#2198
mgamis-msft merged 4 commits intomainfrom
mgamis/fix-react-hook-console-errors

Conversation

@mgamis-msft
Copy link
Copy Markdown
Contributor

@mgamis-msft mgamis-msft commented Aug 10, 2022

What

Fix _usePermissions usage. Not calling it after a logical AND/OR operator which causes React hook console errors

Why

There are React hook console errors as shown in this video for any type of call.
https://user-images.githubusercontent.com/79475487/184026374-f849fc09-b6bf-4e2c-bc82-4c91dad8dfe4.mp4

How Tested

Local sample app test

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 10, 2022

Chat bundle size is not changed.

  • Current size: 5185837
  • Base size: 5185837
  • Diff size: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 10, 2022

CallWithChat bundle size is increased❗.

  • Current size: 5433380
  • Base size: 5433363
  • Diff size: 17

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 10, 2022

Calling bundle size is increased❗.

  • Current size: 5056100
  • Base size: 5056083
  • Diff size: 17

disabled = disabled || !_usePermissions().cameraButton;
const permissions = _usePermissions();
/* @conditional-compile-remove(rooms) */
disabled = disabled || !permissions.cameraButton;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these the same but we just want to give them more space?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the logical OR here is conditionally calling a react hook.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@mgamis-msft mgamis-msft merged commit 5c2e890 into main Aug 11, 2022
@mgamis-msft mgamis-msft deleted the mgamis/fix-react-hook-console-errors branch August 11, 2022 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants