diff --git a/beta/src/content/apis/react/createFactory.md b/beta/src/content/apis/react/createFactory.md index 8bd98951..6bc9959e 100644 --- a/beta/src/content/apis/react/createFactory.md +++ b/beta/src/content/apis/react/createFactory.md @@ -181,7 +181,7 @@ Sometimes, your existing code might pass some variable as a `type` instead of a ```js {3} function Heading({ isSubheading, ...props }) { - let type = isSubheading ? 'h2' : 'h1'; + const type = isSubheading ? 'h2' : 'h1'; const factory = createFactory(type); return factory(props); } @@ -191,7 +191,7 @@ To do the same in JSX, you need to rename your variable to start with an upperca ```js {2,3} function Heading({ isSubheading, ...props }) { - let Type = isSubheading ? 'h2' : 'h1'; + const Type = isSubheading ? 'h2' : 'h1'; return ; } ```