I have a function getFontColor(), that I would like to extract to a utils folder, and call it in a component. This function though, uses a function that is inside my component (getBgColor()). How do I pass getBgColor to the util function and how to I call the util function in my component?
Util function I want to extract:
export const getFontColor = () => {
const bgColor = getBgColor();
return something;
};
Function getBgColor() which is inside the component:
const getBgColor = () => {
return something
};
Calling the util function:
<StyledTitle color={getFontColor}>
{node.label}
</StyledTitle>
How can I communicate those? The main issue, is how do I pass the getBgColor to the external function?