---
title: "Discussion on \"Passing className to components in React\" | Hashnode"
description: "Discussion on \"Passing className to components in React\". In React, we are familiar with the concepts of a className on components. It's the way React adds the class attribute to an element.\nIt looks like this:\n<div className=\"bg-red-200\"></div>\n\nHowever, what happens if we want to make our custom component..."
url: "https://hashnode.com/posts/passing-classname-to-components-in-react/6357a0fd992ee78be0297f05"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Passing className to components in React](https://h.daily-dev-tips.com/passing-classname-to-components-in-react?utm_source=hashnode&utm_medium=feed)

In React, we are familiar with the concepts of a className on components. It's the way React adds the class attribute to an element. It looks like this: <div className="bg-red-200"></div> However, what happens if we want to make our custom component...

Oct 25, 2022 · 2 min read · h.daily-dev-tips.com  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Chris Bongers](https://hashnode.com/@dailydevtips)

@dailydevtips · Cape Town, SA

  
[View profile](https://hashnode.com/@dailydevtips)

Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
