Closed diogofscmariano closed 4 years ago
Features
New prop "injectfirst": allows styling directly into a component overriding material styles
Css classname overhaul: allows defining global class and having deterministic classnames when necessary
More pseudo-classes: support of eight different custom pseudo-classes.
Dynamic styling: added the support for style functions
Performance
Future React compatibility
Misc
This is the most delicate point because we might not be able to control the childrens that were added by users
Some of the components need access to the DOM node. This was previously possible by using ReactDOM.findDOMNode. This function is deprecated in favor of ref and ref forwarding. However, only the following component types can be given a ref:
if we have this problem we will see a warning like this:
Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Invalid prop component supplied to ComponentName. Expected an element type that can hold a ref.
the solution is:
const MyButton = props => <div role="button" {...props} />;
const MyButton = React.forwardRef((props, ref) => <div role="button" {...props} ref={ref} />);
<Button component={MyButton} />;
It was identified that we are having issues with material ui 4 running in storybook, due to multiple instances of the the style package. In this spike we identified that we should do the move, but we need to understand how to fix this. A following spike will be opened.
To be able to move from material 3 to material 4 what we need to do apart from following the migration guide is converting all material related dependencies into a peer dependencies to be installed by whomever is using the ui-kit packages
Description:
Material released their 4.x version and since we will be reviewing all our components we should evaluate if we should move from 3.x to 4.x version.
Important notes:
Estimation: 2 days
Expected outcome: