mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-23 14:57:13 +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 'className': {
|
||||
const nativeProp = 'class';
|
||||
// prevent class names managed by React Native from being replaced
|
||||
const className = `${node.getAttribute(nativeProp)} ${value}`;
|
||||
node.setAttribute(nativeProp, className);
|
||||
node.classList.add(value);
|
||||
break;
|
||||
}
|
||||
case 'text':
|
||||
|
||||
Reference in New Issue
Block a user