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

[docs] Include in docs directive to silence eslint erroneous warning #24644

Merged
merged 2 commits into from
Jan 27, 2021

Conversation

silviot
Copy link
Contributor

@silviot silviot commented Jan 27, 2021

The useBabelRc hook, when used correctly as documented, makes eslint emit
the error:

React Hook "useBabelRc" cannot be called at the top level.
React Hooks must be called in a React function component or a custom React Hook function
react-hooks/rules-of-hooks

Users might be confused by the error and file an issue like this
#24008

To prevent this from happening the documentation now includes the relevant eslint
directive to disable the warning.


The `useBabelRc` hook, when used correctly as documented, makes `eslint` emit
the error:

```
React Hook "useBabelRc" cannot be called at the top level.
React Hooks must be called in a React function component or a custom React Hook function
react-hooks/rules-of-hooks
```

Users might be confused by the error and file an issue like this
mui#24008

To prevent this from happening the documentation now includes the relevant eslint
directive to disable the warning.
@mui-pr-bot
Copy link

mui-pr-bot commented Jan 27, 2021

No bundle size changes

Generated by 🚫 dangerJS against 1cffb0f

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Jan 27, 2021
@oliviertassinari oliviertassinari changed the title Include in docs directive to silence eslint erroneous warning [docs] Include in docs directive to silence eslint erroneous warning Jan 27, 2021
@oliviertassinari oliviertassinari merged commit 3fc9c85 into mui:next Jan 27, 2021
@oliviertassinari
Copy link
Member

@silviot Thanks

xs9627 added a commit to xs9627/material-ui that referenced this pull request Jan 27, 2021
* next: (34 commits)
  [Tab] Migrate to emotion (mui#24651)
  [TextField] Migrate Input component to emotion (mui#24638)
  [ImageList] Migrate ImageListItemBar to emotion (mui#24632)
  [CircularProgress] Migrate to emotion (mui#24622)
  [DataTable] Add example in docs for data table (mui#24428)
  [Card] Migrate CardActionArea to emotion (mui#24636)
  [core] Fix `next` using stale pages (mui#24635)
  [List] Migrate ListItemIcon to emotion (mui#24630)
  [ClickAwayListener] Fix `children` and `onClickAway` types (mui#24565)
  [docs] Include in docs directive to silence `eslint` erroneous warning (mui#24644)
  [Fab] Migrate to emotion (mui#24618)
  [TextField] Migrate FilledInput to emotion (mui#24634)
  [Card] Migrate CardHeader to emotion (mui#24626)
  [Card] Migrate CardMedia to emotion (mui#24625)
  [ImageList] Migrate ImageListItem to emotion (mui#24619)
  [website] Add vision block (mui#24603)
  [docs] Add sorting section (mui#24637)
  [TextField] Prepare removal of labelWidth prop (mui#24595)
  [Dialog] Migrate DialogTitle to emotion (mui#24623)
  [ImageList] Migrate to emotion (mui#24615)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants