I am using the Fluent UI, imported the Toggle component and got a UI Toggle exported:
export const UIToggle: React.FunctionComponent = () => {
return (
<Stack tokens={stackTokens}>
<Toggle label="Enabled and checked" defaultChecked onText="On" offText="Off" />
</Stack>
);
};
but when I want to use it and update the 'label' attribute:
<UIToggle label = "Turn on"></UIToggle>
here is the error:
Type '{ label: string; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }'.
Property 'label' does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }'
Can anyone explain why this error appears and how can I solve it?