mirror of
https://github.com/facebook/react.git
synced 2026-02-23 12:13:04 +00:00
@@ -30,9 +30,11 @@ var contentKey = null;
|
||||
*/
|
||||
function getTextContentAccessor() {
|
||||
if (!contentKey && ExecutionEnvironment.canUseDOM) {
|
||||
contentKey = 'innerText' in document.createElement('div') ?
|
||||
'innerText' :
|
||||
'textContent';
|
||||
// Prefer textContent to innerText because many browsers support both but
|
||||
// SVG <text> elements don't support innerText even when <div> does.
|
||||
contentKey = 'textContent' in document.createElement('div') ?
|
||||
'textContent' :
|
||||
'innerText';
|
||||
}
|
||||
return contentKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user