mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-31 09:44:21 +00:00
[change] use classList in UIManager
Prevent setting the same class multiple times
This commit is contained in:
@@ -53,10 +53,7 @@ const UIManager = {
|
|||||||
}
|
}
|
||||||
case 'class':
|
case 'class':
|
||||||
case 'className': {
|
case 'className': {
|
||||||
const nativeProp = 'class';
|
node.classList.add(value);
|
||||||
// prevent class names managed by React Native from being replaced
|
|
||||||
const className = `${node.getAttribute(nativeProp)} ${value}`;
|
|
||||||
node.setAttribute(nativeProp, className);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'text':
|
case 'text':
|
||||||
|
|||||||
Reference in New Issue
Block a user