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
Only is not type safe: it accepts as and ...props and drill those props. But there is no check to see if those props match what's should be allowed for the component.
We could try to be smart with those types, but as we're rendering just a <Fragment>, I don't think it makes sense.
So instead of a code like this:
constApp=()=>(<ul><Onlyas="li"on="xs">
Only visible for extra small devices (portrait phones)
</Only><Onlyas="li"on="sm">
Only visible for small devices (landscape phones)
</Only><Onlyas="li"on="md">
Only visible for medium devices (tablets)
</Only><Onlyas="li"on="lg">
Only visible for large devices (desktops)
</Only><Onlyas="li"on="xl">
Only visible for extra large devices (large desktops)
</Only><Onlyas="li"on="sm xl">
Only visible for small AND extra large devices
</Only></ul>);
We'd instead do:
constApp=()=>(<ul><Onlyon="xs"><li>Only visible for extra small devices (portrait phones)</li></Only><Onlyon="sm"><li>Only visible for small devices (landscape phones)</li></Only><Onlyon="md"><li>Only visible for medium devices (tablets)</li></Only><Onlyon="lg"><li>Only visible for large devices (desktops)</li></Only><Onlyon="xl"><li>Only visible for extra large devices (large desktops)</li></Only><Onlyon="sm xl"><li>Only visible for small AND extra large devices</li></Only></ul>);
Yes it's a big breaking change, but I don't think this adds a lot of benefits for the codebase
Activity