Creating custom properties in react component
Introduction
Sometimes when we are creating components in React, we might need to create custom properties for productive code.
Code
Example_component.tsx
import React from 'react'
type CardProps = {
ProductName: string
Description: string
Price: string
}
const Card: React.FC<CardProps> = ({ ProductName, Description, Price }) => {
}
export default Card
Import react in your component
Add type for your custom properties
Create your React component
Export your React component as default
Conclusion
Thank you for reading until the end 👍
See you on the next post 👋