Attempting to utilize a variable to set the font color within a react component, encountering an error with my <span>
:
Type '{ style: "color:yellow"; }' is not assignable to type 'HTMLProps<HTMLSpanElement>'
The use of yellow here is only for testing purposes, I plan to replace it with {color} at the end.
import * as React from 'react';
export interface SkillListItemProps {
name: string
color: string
// Icons:
}
interface SkillListItemState{
}
export class SkillListItem extends React.Component<SkillListItemProps,SkillListItemState>{
public render(): JSX.Element{
const {name, color} = this.props;
return (
<div className="SkillListItem">
<span style="color:yellow">{name}</span>
</div>
)
}
}