react-merge-props-and-styles
v0.0.2
Published
react utility to merge multiple props with respect to class names and styles
Downloads
105
Maintainers
Readme
How to use
const propsA = {
className: 'classA',
style: { cursor: 'pointer' },
big: true,
};
const propsB = {
className: 'classB',
style: { display: 'block' },
strong: true,
};
const propsC = {
style: { display: 'none' },
};
merge(propsA, propsB, propsC);
The result
const result = {
className: 'classA classB',
style: {
cursor: 'pointer',
display: 'none',
},
big: true,
strong: true,
}