So I have this component name called "Technologies" where I'm using react-icons
and passing it through props to different component name "Icon" or on a different page.
Technologies Page:
import Icon from './subcomponents/Icon';
const Technologies = () => {
return (
<div className="px-4 py-16 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8 lg:py-20">
<div className="grid grid-cols-2 gap-5 row-gap-5 sm:grid-cols-3 lg:grid-cols-6">
<Icon name={AiFillAndroid}/>
</div>
</div>
);
};
export default Technologies;
And this is the Icon Page, where I'm receiving props data:
import { IconContext } from "react-icons";
import {props.name} from 'react-icons/all'; **// Here is the issue "Is it possible to receive props data like this"**
export default function Icon(props) {
return (
<>
<div className="text-center">
<div className="flex items-center justify-center w-10 h-10 mx-auto mb-4 rounded-full bg-indigo-50 sm:w-12 sm:h-12">
<IconContext.Provider value={{ style: { color: '#fff' } }}>
<{props.name} /> **// Here is the issue "Is it possible to receive props data like this"**
</IconContext.Provider>
</div>
<h6 className="mb-2 text-sm font-bold leading-5 tracking-wider uppercase">
World
</h6>
</div>
</>
)
}