Skip to content

Commit

Permalink
Re-introduce early return
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jun 10, 2024
1 parent 6b414c5 commit e861ac6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/src/components/banner/AppFrameBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import PageContext from 'docs/src/modules/components/PageContext';
import { convertProductIdToName } from 'docs/src/modules/components/AppSearch';

export default function AppFrameBanner() {
const pageContext = React.useContext(PageContext);
const productName = convertProductIdToName(pageContext) || 'MUI';
const message = `Influence ${productName}'s 2024 roadmap! Participate in the latest Developer Survey`;

if (!FEATURE_TOGGLE.enable_docsnav_banner) {
return null;
}

// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/rules-of-hooks -- FEATURE_TOGGLE never changes
const pageContext = React.useContext(PageContext);
const productName = convertProductIdToName(pageContext) || 'MUI';
const message = `Influence ${productName}'s 2024 roadmap! Participate in the latest Developer Survey`;

if (process.env.NODE_ENV !== 'production') {
if (message.length > 100) {
throw new Error(
Expand Down

0 comments on commit e861ac6

Please sign in to comment.