Thumbnail for 🕌 LIVE | Ramadan 1447 | After Asr Hadith Reflection Day 17 | 6th March 2026 by East London Mosque & London Muslim Centre

🕌 LIVE | Ramadan 1447 | After Asr Hadith Reflection Day 17 | 6th March 2026

East London Mosque & London Muslim Centre

2m 24s372 words~2 min read
YouTube auto captions
Transcript source

YouTube auto captions

This transcript was extracted from YouTube's auto-generated caption track. The transcript below is server-rendered so it can be read, searched, cited, and shared without opening the original YouTube player.

Pull quotes
[0:00]Today we're going to be talking about how to create custom components in React using TypeScript.
[0:00]This is a really powerful technique that allows you to reuse your code, make it more maintainable, and also improve the overall readability of your application.
[0:00]Inside your `src` folder, create a new folder called `components`, and inside that, create `Button.tsx`.
[0:00]We'll have a `children` prop for the button text, an `onClick` prop for handling clicks, and an optional `color` prop.
Use this transcript
Related transcript hubs

[0:00]Hello, welcome back to the channel. Today we're going to be talking about how to create custom components in React using TypeScript. This is a really powerful technique that allows you to reuse your code, make it more maintainable, and also improve the overall readability of your application. So, let's dive right in. First, we need to set up our React project with TypeScript. If you already have a project, you can skip this step. Otherwise, you can use Create React App with the TypeScript template. Once your project is set up, let's create our first custom component. We'll start with a simple button component. Inside your `src` folder, create a new folder called `components`, and inside that, create `Button.tsx`. Now, let's define the props for our button component. We'll use an interface to do this, which provides type checking for our props. We'll have a `children` prop for the button text, an `onClick` prop for handling clicks, and an optional `color` prop. Next, we'll write the functional component itself. This will be a standard React functional component that accepts our `ButtonProps` interface. Inside the component, we'll render a simple HTML button element, passing in the `children`, `onClick`, and `color` props. To make our button more dynamic, let's add some styling. We can use inline styles or a CSS module for this. For simplicity, we'll use inline styles for now. We'll define a `buttonStyle` object and apply it to our button element. Now that our button component is created, let's use it in our `App.tsx` file. Import the `Button` component and then render it, passing in the required `children` and `onClick` props. You can also pass in the optional `color` prop to see how it changes the button's appearance. And there you have it! You've successfully created and used a custom component in React with TypeScript. This basic example can be extended to create much more complex and reusable components, improving your development workflow significantly. Remember, the key benefits are code reusability, improved maintainability, and stronger type checking thanks to TypeScript. If you found this tutorial helpful, please like this video and subscribe to the channel for more content like this. Thanks for watching, and I'll see you in the next one!

Need another transcript?

Paste any YouTube URL to get a clean transcript in seconds.

Get a Transcript