diff --git a/curriculum/challenges/english/25-front-end-development/review-react-basics/67487e141bb6a7140a352e12.md b/curriculum/challenges/english/25-front-end-development/review-react-basics/67487e141bb6a7140a352e12.md index 93a42bcb3da..fc54d95ee7a 100644 --- a/curriculum/challenges/english/25-front-end-development/review-react-basics/67487e141bb6a7140a352e12.md +++ b/curriculum/challenges/english/25-front-end-development/review-react-basics/67487e141bb6a7140a352e12.md @@ -37,15 +37,15 @@ Here is an example of a simple React component that renders a greeting message: ```jsx function Greeting() { - const name = 'Anna'; - return

Welcome, {name}!

; + const name = 'Anna'; + return

Welcome, {name}!

; } ``` To use the component, you can simply call: ```jsx - + ``` ## Importing and Exporting React components @@ -56,7 +56,7 @@ To use the component, you can simply call: ```jsx // City.js function City() { - return

New York

; + return

New York

; } export default City; @@ -69,12 +69,12 @@ export default City; import City from './City'; function App() { - return ( -
-

My favorite city is:

- -
- ); + return ( +
+

My favorite city is:

+ +
+ ); } ``` @@ -84,7 +84,7 @@ function App() { ```jsx export default function City() { - return

New York

; + return

New York

; } ``` @@ -129,13 +129,13 @@ npm run dev ```jsx // Parent component function Parent() { - const name = 'Anna'; - return ; + const name = 'Anna'; + return ; } // Child component function Child(props) { - return

Hello, {props.name}!

; + return

Hello, {props.name}!

; } ``` @@ -144,12 +144,12 @@ You can pass multiple props using the spread operator `(...)`, after converting ```jsx // Parent component function Parent() { - const person = { - name: 'Anna', - age: 25, - city: 'New York' - }; - return ; + const person = { + name: 'Anna', + age: 25, + city: 'New York' + }; + return ; } ``` @@ -162,11 +162,11 @@ In this code, the spread operator `{...person}` converts the person object into ```jsx function Greeting({ isLoggedIn }) { - return ( -
- {isLoggedIn ?

Welcome back!

:

Please log in

} -
- ); + return ( +
+ {isLoggedIn ?

Welcome back!

:

Please log in

} +
+ ); } ``` @@ -174,11 +174,11 @@ function Greeting({ isLoggedIn }) { ```jsx function Greeting({ user }) { - return ( -
- {user &&

Welcome, {user.name}!

} -
- ); + return ( +
+ {user &&

Welcome, {user.name}!

} +
+ ); } ``` @@ -192,13 +192,13 @@ In the code above, the `h1` element is only rendered if the user object is truth ```jsx function NameList({ names }) { - return ( -
    - {names.map((name, index) => ( -
  • {name}
  • - ))} -
- ); + return ( +
    + {names.map((name, index) => ( +
  • {name}
  • + ))} +
+ ); } ``` @@ -211,13 +211,13 @@ function NameList({ names }) { ```jsx function Greeting() { - const styles = { - color: 'blue', - fontSize: '24px', - backgroundColor: 'lightgray' - }; + const styles = { + color: 'blue', + fontSize: '24px', + backgroundColor: 'lightgray' + }; - return

Hello, world!

; + return

Hello, world!

; } ``` @@ -225,12 +225,12 @@ function Greeting() { ```jsx function Greeting({ isImportant }) { - const styles = { - color: isImportant ? 'red' : 'black', - fontSize: isImportant ? '24px' : '16px' - }; + const styles = { + color: isImportant ? 'red' : 'black', + fontSize: isImportant ? '24px' : '16px' + }; - return

Hello, world!

; + return

Hello, world!

; } ```