Course Content
React Mastery
React Mastery
1. Introduction to React Fundamentals
What is React?SPAs vs. MPAs in Web DevelopmentHow React Works with the Virtual DOMIntroducing JSX in ReactCreating Complex JSX Elements Rendering Elements in ReactChallenge: Rendering ElementReact ComponentProps in ReactChallenge: Functional ComponentsConditional RenderingChallenge: Conditional Rendering - Chat NotificationChallenge: Conditional Rendering - Bank AlertRendering a Data CollectionChallenge: Rendering a Data CollectionIntroduction to React Section Sum-Up
2. Styling in React Apps
Introduction to Styling in ReactInline StylesInline Styles in PracticeChallenge: Inline StylesStyling with the CSS FileStyling with the CSS File in PracticeChallenge: Styling with the CSS FileStyling with the CSS ModulesFile Folder Structure OrganizationChallenge: CSS ModulesStyling in React Section Sum-Up
3. React Hooks and Context
Introduction: React Hooks and ContextuseState HookChallenge: Toggling VisibilityuseRef HookChallenge: Creating a Form ComponentuseEffect HookChallenge: Fetching and Displaying DatauseMemo HookChallenge: Car List FilteringContextContext in PracticeChallenge: World of Astronomy AppReact Hooks and Context Section Sum Up
Challenge: Inline Styles
We will practice adding inline styles to a React component. Follow the steps below to complete the challenge:
-
Create a new React component called
StyledBox
. -
Inside the
StyledBox
component, render a<div>
element. -
Add the following inline styles to the
<div>
element:- Set the background color to
"lightblue"
; - Set the width to
"300px"
; - Set the padding to
"10px"
; - Set the border radius to
"10px"
; - Set the text alignment to
"center"
; - Set the font size to
"24px"
; - Set the font weight to
"bold"
.
- Set the background color to
-
Add some text content inside the
<div>
element, such asFive Finger Death Punch
.
- Inline styles are added using the
style
attribute, and the value for this attribute should be an object. - When using inline styles, values that are not plain numbers (such as strings, units, or colors) should be enclosed in quotes
"..."
. For example,margin: "30px"
indicates that themargin
property has a value of30px
.
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 4