code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function typeName(value) { { // toStringTag is needed for namespaced types like Temporal.Instant var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; return type; } } // $F...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
typeName
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } }
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
willCoercionThrow
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function testStringCoercion(value) { // If you ended up here by following an exception call stack, here's what's // happened: you supplied an object or symbol value to React (as a prop, key, // DOM attribute, CSS property, string ref, etc.) and when React tried to // coerce it to a string using `'' + va...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
testStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkAttributeStringCoercion(value, attributeName) { { if (willCoercionThrow(value)) { error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value)); return testStringCoercion(v...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
checkAttributeStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troublesh...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
checkKeyStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkPropStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); return testStringCoercion(value); // throw (to ...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
checkPropStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkCSSPropertyStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); return testStringCoercion(value)...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
checkCSSPropertyStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkHtmlStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help cal...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
checkHtmlStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkFormFieldValueStringCoercion(value) { { if (willCoercionThrow(value)) { error('Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); ret...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
checkFormFieldValueStringCoercion
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { return true; } if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validated...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
isAttributeNameSafe
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null) { return propertyInfo.type === RESERVED; } if (isCustomComponentTag) { return false; } if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
shouldIgnoreAttribute
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } switch (typeof value) { case 'function': // $FlowIssue symbol is perfectly valid here case 'symbol': // esli...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
shouldRemoveAttributeWithWarning
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { if (value === null || typeof value === 'undefined') { return true; } if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { return true; } if (isCustomComponentTag) { ...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
shouldRemoveAttribute
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; }
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
getPropertyInfo
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
PropertyInfoRecord
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
capitalize = function (token) { return token[1].toUpperCase(); }
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
capitalize
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function sanitizeURL(url) { { if (!didWarn && isJavaScriptProtocol.test(url)) { didWarn = true; error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetI...
Mapping from lowercase registration names to the properly cased version, used to warn in the case of missing event handlers. Available only in true. @type {Object}
sanitizeURL
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getValueForProperty(node, name, expected, propertyInfo) { { if (propertyInfo.mustUseProperty) { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { // This check protects multiple uses of `expected`, which is why the // react-interna...
Get the value for a property on a node. Only used in DEV for SSR validation. The "expected" argument is used as a hint of what the expected value is. Some properties have multiple equivalent values.
getValueForProperty
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getValueForAttribute(node, name, expected, isCustomComponentTag) { { if (!isAttributeNameSafe(name)) { return; } if (!node.hasAttribute(name)) { return expected === undefined ? undefined : null; } var value = node.getAttribute(name); { checkAtt...
Get the value for a attribute on a node. Only used in DEV for SSR validation. The third argument is used as a hint of what the expected value is. Some attributes have multiple equivalent values.
getValueForAttribute
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function setValueForProperty(node, name, value, isCustomComponentTag) { var propertyInfo = getPropertyInfo(name); if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { return; } if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { value = null; ...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
setValueForProperty
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { ret...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getIteratorFn
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollap...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
disableLogs
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. ...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
reenableLogs
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
describeBuiltInComponentFrame
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if ( !fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
describeNativeComponentFrame
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
Fake = function () { throw Error(); }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
Fake
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function describeClassComponentFrame(ctor, source, ownerFn) { { return describeNativeComponentFrame(ctor, true); } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
describeClassComponentFrame
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
describeFunctionComponentFrame
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
shouldConstruct
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInC...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
describeUnknownElementTypeFrameInDEV
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function describeFiber(fiber) { var owner = fiber._debugOwner ? fiber._debugOwner.type : null ; var source = fiber._debugSource ; switch (fiber.tag) { case HostComponent: return describeBuiltInComponentFrame(fiber.type); case LazyComponent: return describeBuiltInComponentFram...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
describeFiber
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getStackByFiberInDevAndProd(workInProgress) { try { var info = ''; var node = workInProgress; do { info += describeFiber(node); node = node.return; } while (node); return info; } catch (x) { return '\nError generating stack: ' + x.message + '\n' + x...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getStackByFiberInDevAndProd
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ''; return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; ...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getWrappedName
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getContextName(type) { return type.displayName || 'Context'; } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getContextName
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getComponentNameFromType(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an i...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getComponentNameFromType
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getWrappedName$1(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ''; return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } // Keep in sync with shared/getComponentNameFromType
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getWrappedName$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getContextName$1(type) { return type.displayName || 'Context'; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getContextName$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getComponentNameFromFiber(fiber) { var tag = fiber.tag, type = fiber.type; switch (tag) { case CacheComponent: return 'Cache'; case ContextConsumer: var context = type; return getContextName$1(context) + '.Consumer'; case ContextProvider: var...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getComponentNameFromFiber
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getCurrentFiberOwnerNameInDevOrNull() { { if (current === null) { return null; } var owner = current._debugOwner; if (owner !== null && typeof owner !== 'undefined') { return getComponentNameFromFiber(owner); } } return null; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getCurrentFiberOwnerNameInDevOrNull
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getCurrentFiberStackInDev() { { if (current === null) { return ''; } // Safe because if current fiber exists, we are reconciling, // and it is guaranteed to be the work-in-progress version. return getStackByFiberInDevAndProd(current); } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getCurrentFiberStackInDev
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function resetCurrentFiber() { { ReactDebugCurrentFrame.getCurrentStack = null; current = null; isRendering = false; } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
resetCurrentFiber
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function setCurrentFiber(fiber) { { ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; current = fiber; isRendering = false; } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
setCurrentFiber
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getCurrentFiber() { { return current; } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getCurrentFiber
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function setIsRendering(rendering) { { isRendering = rendering; } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
setIsRendering
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function toString(value) { // The coercion safety check is performed in getToStringValue(). // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
toString
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getToStringValue(value) { switch (typeof value) { case 'boolean': case 'number': case 'string': case 'undefined': return value; case 'object': { checkFormFieldValueStringCoercion(value); } return value; default: // fun...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getToStringValue
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkControlledValueProps(tagName, props) { { if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-onl...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
checkControlledValueProps
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function isCheckable(elem) { var type = elem.type; var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
isCheckable
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getTracker(node) { return node._valueTracker; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getTracker
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function detachTracker(node) { node._valueTracker = null; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
detachTracker
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getValueFromNode(node) { var value = ''; if (!node) { return value; } if (isCheckable(node)) { value = node.checked ? 'true' : 'false'; } else { value = node.value; } return value; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getValueFromNode
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function trackValueOnNode(node) { var valueField = isCheckable(node) ? 'checked' : 'value'; var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); { checkFormFieldValueStringCoercion(node[valueField]); } var currentValue = '' + node[valueField]; // if someo...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
trackValueOnNode
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function track(node) { if (getTracker(node)) { return; } // TODO: Once it's just Fiber we can move this to node._wrapperState node._valueTracker = trackValueOnNode(node); }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
track
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function updateValueIfChanged(node) { if (!node) { return false; } var tracker = getTracker(node); // if there is no tracker at this point it's unlikely // that trying again will succeed if (!tracker) { return true; } var lastValue = tracker.getValue(); var nextValue = get...
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
updateValueIfChanged
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getActiveElement(doc) { doc = doc || (typeof document !== 'undefined' ? document : undefined); if (typeof doc === 'undefined') { return null; } try { return doc.activeElement || doc.body; } catch (e) { return doc.body; } }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
getActiveElement
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function isControlled(props) { var usesChecked = props.type === 'checkbox' || props.type === 'radio'; return usesChecked ? props.checked != null : props.value != null; }
Sets the value for a property on a node. @param {DOMElement} node @param {string} name @param {*} value
isControlled
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getHostProps(element, props) { var node = element; var checked = props.checked; var hostProps = assign({}, props, { defaultChecked: undefined, defaultValue: undefined, value: undefined, checked: checked != null ? checked : node._wrapperState.initialChecked }); return...
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
getHostProps
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function initWrapperState(element, props) { { checkControlledValueProps('input', props); if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elemen...
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
initWrapperState
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function updateChecked(element, props) { var node = element; var checked = props.checked; if (checked != null) { setValueForProperty(node, 'checked', checked, false); } }
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
updateChecked
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function updateWrapper(element, props) { var node = element; { var controlled = isControlled(props); if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by ...
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
updateWrapper
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function postMountWrapper(element, props, isHydrating) { var node = element; // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { var type = props.type; va...
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
postMountWrapper
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function restoreControlledState(element, props) { var node = element; updateWrapper(node, props); updateNamedCousins(node, props); }
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
restoreControlledState
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function updateNamedCousins(rootNode, props) { var name = props.name; if (props.type === 'radio' && name != null) { var queryRoot = rootNode; while (queryRoot.parentNode) { queryRoot = queryRoot.parentNode; } // If `rootNode.form` was non-null, then we could try `form.elements`, ...
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
updateNamedCousins
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function setDefaultValue(node, type, value) { if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js type !== 'number' || getActiveElement(node.ownerDocument) !== node) { if (value == null) { node.defaultValue = toString(node._wrapperState.initialValue); } else if (node....
Implements an <input> host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not ...
setDefaultValue
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function validateProps(element, props) { { // If a value is not provided, then the children must be simple. if (props.value == null) { if (typeof props.children === 'object' && props.children !== null) { React.Children.forEach(props.children, function (child) { if (child ==...
Implements an <option> host component that warns when `selected` is set.
validateProps
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function postMountWrapper$1(element, props) { // value="" should make a value attribute (#6219) if (props.value != null) { element.setAttribute('value', toString(getToStringValue(props.value))); } }
Implements an <option> host component that warns when `selected` is set.
postMountWrapper$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function isArray(a) { return isArrayImpl(a); }
Implements an <option> host component that warns when `selected` is set.
isArray
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getDeclarationErrorAddendum() { var ownerName = getCurrentFiberOwnerNameInDevOrNull(); if (ownerName) { return '\n\nCheck the render method of `' + ownerName + '`.'; } return ''; }
Implements an <option> host component that warns when `selected` is set.
getDeclarationErrorAddendum
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function checkSelectPropTypes(props) { { checkControlledValueProps('select', props); for (var i = 0; i < valuePropNames.length; i++) { var propName = valuePropNames[i]; if (props[propName] == null) { continue; } var propNameIsArray = isArray(props[propName]);...
Validation function for `value` and `defaultValue`.
checkSelectPropTypes
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function updateOptions(node, multiple, propValue, setDefaultSelected) { var options = node.options; if (multiple) { var selectedValues = propValue; var selectedValue = {}; for (var i = 0; i < selectedValues.length; i++) { // Prefix to avoid chaos with special keys. selectedVa...
Validation function for `value` and `defaultValue`.
updateOptions
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getHostProps$1(element, props) { return assign({}, props, { value: undefined }); }
Implements a <select> host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option ...
getHostProps$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function initWrapperState$1(element, props) { var node = element; { checkSelectPropTypes(props); } node._wrapperState = { wasMultiple: !!props.multiple }; { if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) { error('Sel...
Implements a <select> host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option ...
initWrapperState$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function postMountWrapper$2(element, props) { var node = element; node.multiple = !!props.multiple; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } else if (props.defaultValue != null) { updateOptions(node, !!props.multiple, props.def...
Implements a <select> host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option ...
postMountWrapper$2
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function postUpdateWrapper(element, props) { var node = element; var wasMultiple = node._wrapperState.wasMultiple; node._wrapperState.wasMultiple = !!props.multiple; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } else if (wasMultiple !...
Implements a <select> host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option ...
postUpdateWrapper
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function restoreControlledState$1(element, props) { var node = element; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } }
Implements a <select> host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option ...
restoreControlledState$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getHostProps$2(element, props) { var node = element; if (props.dangerouslySetInnerHTML != null) { throw new Error('`dangerouslySetInnerHTML` does not make sense on <textarea>.'); } // Always set children to the same thing. In IE9, the selection range will // get reset if `textContent` is...
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
getHostProps$2
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function initWrapperState$2(element, props) { var node = element; { checkControlledValueProps('textarea', props); if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) { error('%s contains a textarea with both value and defaultValue props. ' + 'Textare...
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
initWrapperState$2
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function updateWrapper$1(element, props) { var node = element; var value = getToStringValue(props.value); var defaultValue = getToStringValue(props.defaultValue); if (value != null) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as ne...
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
updateWrapper$1
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function postMountWrapper$3(element, props) { var node = element; // This is in postMount because we need access to the DOM node, which is not // available until after the component has mounted. var textContent = node.textContent; // Only set node.value if textContent is equal to the expected // initia...
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
postMountWrapper$3
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function restoreControlledState$2(element, props) { // DOM component is still mounted; update updateWrapper$1(element, props); }
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
restoreControlledState$2
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getIntrinsicNamespace(type) { switch (type) { case 'svg': return SVG_NAMESPACE; case 'math': return MATH_NAMESPACE; default: return HTML_NAMESPACE; } }
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
getIntrinsicNamespace
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function getChildNamespace(parentNamespace, type) { if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { // No (or default) parent namespace: potential entry point. return getIntrinsicNamespace(type); } if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') { /...
Implements a <textarea> host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is suppl...
getChildNamespace
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
createMicrosoftUnsafeLocalFunction = function (func) { if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { return function (arg0, arg1, arg2, arg3) { MSApp.execUnsafeLocalFunction(function () { return func(arg0, arg1, arg2, arg3); }); }; } else { retu...
Create a function which has 'unsafe' privileges (required by windows8 apps)
createMicrosoftUnsafeLocalFunction
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
setTextContent = function (node, text) { if (text) { var firstChild = node.firstChild; if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) { firstChild.nodeValue = text; return; } } node.textContent = text; }
Set the textContent property of a node. For text updates, it's faster to set the `nodeValue` of the Text node directly instead of using `.textContent` which will remove the existing node and create a new one. @param {DOMElement} node @param {string} text @internal
setTextContent
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); }
@param {string} prefix vendor-specific prefix, eg: Webkit @param {string} key style name, eg: transitionDuration @return {string} style name prefixed with `prefix`, properly camelCased, eg: WebkitTransitionDuration
prefixKey
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function dangerousStyleValue(name, value, isCustomProperty) { // Note that we've removed escapeTextForBrowser() calls here since the // whole string will be escaped when the attribute is injected into // the markup. If you provide unsafe user data here they can inject // arbitrary CSS which may be probl...
Convert a value into the proper css writable value. The style name `name` should be logical (no hyphens), as specified in `CSSProperty.isUnitlessNumber`. @param {string} name CSS property name such as `topMargin`. @param {*} value CSS property value such as `10px`. @return {string} Normalized style value with dimensio...
dangerousStyleValue
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function hyphenateStyleName(name) { return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); }
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
hyphenateStyleName
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
camelize = function (string) { return string.replace(hyphenPattern, function (_, character) { return character.toUpperCase(); }); }
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
camelize
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
warnHyphenatedStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests // (http://www.andismith.com/blog/2...
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
warnHyphenatedStyleName
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
warnBadVendoredStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); ...
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
warnBadVendoredStyleName
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
warnStyleValueWithSemicolon = function (name, value) { if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { return; } warnedStyleValues[value] = true; error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badS...
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
warnStyleValueWithSemicolon
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
warnStyleValueIsNaN = function (name, value) { if (warnedForNaNValue) { return; } warnedForNaNValue = true; error('`NaN` is an invalid value for the `%s` css style property.', name); }
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
warnStyleValueIsNaN
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
warnStyleValueIsInfinity = function (name, value) { if (warnedForInfinityValue) { return; } warnedForInfinityValue = true; error('`Infinity` is an invalid value for the `%s` css style property.', name); }
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') < "background-color" > hyphenateStyleName('MozTransition') < "-moz-transition" > hyphenateStyleName('msTransition') < "-ms-transition" As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix...
warnStyleValueIsInfinity
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function createDangerousStringForStyles(styles) { { var serialized = ''; var delimiter = ''; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var styleValue = styles[styleName]; if (styleValue != null) { var...
This creates a string that is expected to be equivalent to the style attribute generated by server-side rendering. It by-passes warnings and security checks so it's not safe to use this value for anything other than comparison. It is only used in DEV for SSR validation.
createDangerousStringForStyles
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function setValueForStyles(node, styles) { var style = node.style; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var isCustomProperty = styleName.indexOf('--') === 0; { if (!isCustomProperty) { warnValidStyle$1(styleName...
Sets the value for multiple styles on a node. If a value is specified as '' (empty string), the corresponding style property will be unset. @param {DOMElement} node @param {object} styles
setValueForStyles
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function isValueEmpty(value) { return value == null || typeof value === 'boolean' || value === ''; }
Sets the value for multiple styles on a node. If a value is specified as '' (empty string), the corresponding style property will be unset. @param {DOMElement} node @param {object} styles
isValueEmpty
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function expandShorthandMap(styles) { var expanded = {}; for (var key in styles) { var longhands = shorthandToLonghand[key] || [key]; for (var i = 0; i < longhands.length; i++) { expanded[longhands[i]] = key; } } return expanded; }
Given {color: 'red', overflow: 'hidden'} returns { color: 'color', overflowX: 'overflow', overflowY: 'overflow', }. This can be read as "the overflowY property was set by the overflow shorthand". That is, the values are the property that each was derived from.
expandShorthandMap
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { { if (!nextStyles) { return; } var expandedUpdates = expandShorthandMap(styleUpdates); var expandedStyles = expandShorthandMap(nextStyles); var warnedAbout = {}; for (var key in expandedUpdates...
When mixing shorthand and longhand property names, we warn during updates if we expect an incorrect result to occur. In particular, we warn for: Updating a shorthand property (longhand gets overwritten): {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} becomes .style.font = 'baz' Removing a s...
validateShorthandPropertyCollisionInDev
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function assertValidProps(tag, props) { if (!props) { return; } // Note the use of `==` which checks for null or undefined. if (voidElementTags[tag]) { if (props.children != null || props.dangerouslySetInnerHTML != null) { throw new Error(tag + " is a void element tag and must neither ...
When mixing shorthand and longhand property names, we warn during updates if we expect an incorrect result to occur. In particular, we warn for: Updating a shorthand property (longhand gets overwritten): {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} becomes .style.font = 'baz' Removing a s...
assertValidProps
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT
function isCustomComponent(tagName, props) { if (tagName.indexOf('-') === -1) { return typeof props.is === 'string'; } switch (tagName) { // These are reserved SVG and MathML elements. // We don't mind this list too much because we expect it to never grow. // The alternative is to t...
When mixing shorthand and longhand property names, we warn during updates if we expect an incorrect result to occur. In particular, we warn for: Updating a shorthand property (longhand gets overwritten): {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} becomes .style.font = 'baz' Removing a s...
isCustomComponent
javascript
facebook/memlab
packages/lens/src/tests/lib/react-dom-v18.dev.js
https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js
MIT