Contenido del Curso
React Mastery
React Mastery
1. Fundamentals of React and Component-Based UI
What Is React and Why Use It?Comparing SPAs and MPAs in Web DevelopmentHow React Works with the Virtual DOMIntroducing JSX for Writing HTML in JavaScriptBuilding Complex UI with JSX Rendering Elements in ReactChallenge: Render an Element in ReactUnderstanding React ComponentsPassing Data with Props in ReactChallenge: Create Functional ComponentsConditional Rendering in ReactChallenge: Implement Conditional Rendering – Chat NotificationChallenge: Implement Conditional Rendering – Bank AlertRendering Collections of Data in ReactChallenge: Display Data Collections in ReactReact Fundamentals Wrap-Up
2. Styling Techniques in React Applications
Introduction to Styling in ReactUsing Inline Styles in ReactApplying Inline Styles in PracticeChallenge: Use Inline Styles in a React ComponentStyling React Components with External CSSApplying External CSS in PracticeChallenge: Apply External CSS to a React AppUsing CSS Modules for Scoped Styling in React Organizing File and Folder Structures for StylesChallenge: Use CSS Modules in React Styling Techniques in React Wrap-Up
3. React Hooks and Context for State Management
Introduction to React Hooks and ContextManaging State with the useState HookChallenge: Toggle Visibility with useStateWorking with References Using the useRef HookChallenge: Build a Controlled Form ComponentHandling Side Effects with the useEffect HookChallenge: Fetch and Display Data with useEffectOptimizing Performance with the useMemo HookChallenge: Implement a Car List Filter with useMemoSharing State Across Components with ContextUsing Context in a Real-World ScenarioChallenge: Build a World of Astronomy App with ContextReact Hooks and Context Wrap-Up
Challenge: Apply External CSS to a React App
Task
We will now proceed to create the Alert
component, which will render all the elements passed as children and apply some specific styles to it. The task is:
- Create the component
Alert
that has thediv
element inside. - The
div
element should have thealert
class name. - The
div
element should have thechildren
prop as the content. - The
div
element should have the following CSS.
- To create a
div
element in the component, use<div>...</div>
. - To pass
props.children
as the text content enclose it within{...}
and setprops.children
. Result:<div>{props.children}</div>
. - To add a class name to the
div
element, use theclassName
attribute and set it toalert
. Result:className="alert"
. - To import the file with styles in the
index.js
file, useimport
statement and provide the correct path to the file. Result:import './index.css'
. - To apply styles to the
div
element, use the class name selector.alert
and insert the styles from the task.
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 7