---
title: "Discussion on \"Passing icons as props in a consistent way using React\" | Hashnode"
description: "Discussion on \"Passing icons as props in a consistent way using React\". Let's say that you have a card component that looks like this:\n\nYou could use this card on something like a dashboard and give it a unique header and icon to allow the user to differentiate what is being displayed.\n\nA common way to design this compon..."
url: "https://hashnode.com/posts/passing-icons-as-props-in-a-consistent-way-using-react/6043b3ca8458d42fc821b3b2"
---

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

Discussion

# [Passing icons as props in a consistent way using React](https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react?utm_source=hashnode&utm_medium=feed)

Let's say that you have a card component that looks like this: You could use this card on something like a dashboard and give it a unique header and icon to allow the user to differentiate what is being displayed. A common way to design this compon...

Mar 6, 2021 · 4 min read · ozzie.sh  
Updated Apr 2, 2021  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#react-native](https://hashnode.com/tag/react-native)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Ozzie Neher](https://hashnode.com/@ozziexsh)

@ozziexsh · Saskatoon, SK, Canada

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

Full Stack Dev

## Responses 3

Markdown supported · ⌘↵ to post

[Lucas Rinaldi](https://hashnode.com/@lhrinaldi)

[Mar 31, 2021](https://hashnode.com/posts/passing-icons-as-props-in-a-consistent-way-using-react/6043b3ca8458d42fc821b3b2/comment/6064af9e574933157db93192)

Good improvement of the API.

Just a warning about calling components as function. [kentcdodds.com/blog/dont-call-a-react-function-co…](https://kentcdodds.com/blog/dont-call-a-react-function-component)

[Ozzie Neher](https://hashnode.com/@ozziexsh)

[Apr 2, 2021](https://hashnode.com/posts/passing-icons-as-props-in-a-consistent-way-using-react/6043b3ca8458d42fc821b3b2/comment/6064af9e574933157db93192#reply-6067349643f7713266913fd4)

Thanks, I've updated the post to reflect this :)

[Catalin Pit](https://hashnode.com/@Catalinpit)

[Mar 8, 2021](https://hashnode.com/posts/passing-icons-as-props-in-a-consistent-way-using-react/6043b3ca8458d42fc821b3b2/comment/6045c7518458d42fc821cadf)

Nice one! Keep them coming!

[Ndeye Fatou Diop](https://hashnode.com/@fatou)

[Mar 7, 2021](https://hashnode.com/posts/passing-icons-as-props-in-a-consistent-way-using-react/6043b3ca8458d42fc821b3b2/comment/6044c1cf5a56f82fa3eccae1)

Very nice! I think though the function will run anytime the app rerenders so you may want to use React.useMemo in some cases ☺️

[Ozzie Neher](https://hashnode.com/@ozziexsh)

[Mar 7, 2021](https://hashnode.com/posts/passing-icons-as-props-in-a-consistent-way-using-react/6043b3ca8458d42fc821b3b2/comment/6044c1cf5a56f82fa3eccae1#reply-6045232a5a56f82fa3eccfd8)

Yes thank you that is a great point!
