You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constisString=(element: any): element is string=>{returntypeofelement==="string"||elementinstanceofString;};
Changed the renderHeader func like so:
constrenderHeader=()=>(<MuiTabkey={isString(label) ? label : label.props.key}// <-- Might be a better idea to use the FormTab key herelabel={isString(label) ? translate(label,{_: label}) : label}// .../>);
Change the FormTabProps label declaration like so:
The obvious downside is that I lost the ability to have my translation key translated automatically when an element is used instead of plain string. But other than that, seems to be working fine. Any thoughts?
The text was updated successfully, but these errors were encountered:
Currently, the FormTab component declares
label
prop asstring
type (here):However, the FormTab component merely passes the prop value to MuiTab component (translated though), as seen here:
And the MuiTab component declares the
label
asReactNode
, as seen here:To work around this limitation, I did this:
renderHeader
func like so:label
declaration like so:The obvious downside is that I lost the ability to have my translation key translated automatically when an element is used instead of plain string. But other than that, seems to be working fine. Any thoughts?
The text was updated successfully, but these errors were encountered: