|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/build-polymorphic-components-with-react-and-typescript/
课程评论:没有评论
课程名称:使用 React 和 TypeScript 构建多态组件 课程概述: 本课程旨在扩展您对可重用组件的理解,采用您所喜爱的开源 React 库中使用的技术。您可能已经使用过多态组件,比如 Material UI 的 component prop 或 Chakra UI 的 as prop。在本课程中,您将学习如何构建自己的多态组件,并使其能够作为任何有效的 HTML 元素进行渲染。更重要的是,您将学习如何根据提供的元素类型对其允许的 props 进行强类型定义。课程中将讨论多个使用案例和边缘案例,以帮助您构建更强健的可重用 React 组件,并提供出色的开发体验。 知识应用: - 构建更灵活的可重用组件 - 将所学知识应用于构建自己的设计系统 - 探索中级 TypeScript 概念,以实现真正强类型的多态组件 课程 prerequisites(先决条件): - 您需对 React 有基本的了解 - 您需对 TypeScript 有基本的了解(至少要知道“类型”是指什么) 适合人群: - 构建设计系统的 React 开发者 - 构建可重用组件的 React 开发者 - React 和 TypeScript 开发者 - 其他对中级 React 开发感兴趣的开发者 总结: 这不是一门初学者课程。您需要掌握一些 React 和 TypeScript 的基础知识。您将在本课程中学习中级 TypeScript,课程将实用、高效且切中要点,您将实际完成课程。您将学习构建自己的多态组件,使其能够渲染为任何有效的 HTML 元素。相对简单的是构建组件,而真正的挑战在于根据提供的元素类型强类型其允许的 props。这将涉及动态限制组件 props、类型安全的 refs 传递,以及构建任何其他可重用组件的实用工具。整个过程中将讨论多个使用案例和边缘案例,以帮助您构建更强健的可重用 React 组件并提升开发体验。
Extend your knowledge of reusable components and utilise techniques used by your favourite open-source React libraries...Polymorphic components?You've probably used them before.If you've used material UI's component prop or Chakra UI's as prop, then you've already encountered polymorphic React components.In this class, you will learn to build your own polymorphic component that can be rendered as any valid HTML element. More importantly, you will learn to strongly type its allowed props based on the supplied element type. There will be many use cases and edge cases discussed along the way to help you build more robust reusable React components with a great developer experience.How can you apply this knowledge?Build more flexible reusable componentsApply the gained knowledge to building your own design systemExplore intermediate Typescript concepts for truly strongly typed polymorphic componentsPrerequisitesYou are familiar with React basicsYou are familiar with Typescript basicsWho is this class for?React developers building design systemsReact developers building reusable componentsReact Typescript developersOther curious intermediate React developersIn summary, this is not a beginner's course. You need to know some React, and some Typescript (the basics at least i.e., you know what "types" are).You will learn intermediate typescript in this course. It'll be practical, effective and straight to the point - a course you will actually complete. You will learn to build your own polymorphic component that can be rendered as any valid HTML element. That's easy! What's not so easy is strongly typing its allowed props based on the supplied element type. Restricting the component props dynamically, type-safe the passed refs to the props and even building a utility you can reuse on any other reusable component. There will be many use cases and edge cases discussed along the way to help you build more robust reusable React components with a great developer experience.