jsx-dom-cjs
Advanced tools
Comparing version 8.0.1-beta.2 to 8.0.1-beta.4
50
index.js
@@ -51,5 +51,2 @@ /* eslint-disable */ | ||
} | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
@@ -233,2 +230,19 @@ const isUnitlessNumber = { | ||
appendChild(children, node) | ||
if (node instanceof window.HTMLSelectElement && attr.value != null) { | ||
if (attr.multiple === true && Array.isArray(attr.value)) { | ||
const values = attr.value.map(value => String(value)) | ||
node | ||
.querySelectorAll("option") | ||
.forEach(option => (option.selected = values.includes(option.value))) | ||
} else { | ||
node.value = attr.value | ||
} | ||
} | ||
if (isRef(attr.ref)) { | ||
attr.ref.current = node | ||
} else if (isFunction(attr.ref)) { | ||
attr.ref(node) | ||
} | ||
} else if (isFunction(tag)) { | ||
@@ -244,8 +258,2 @@ if (isObject(tag.defaultProps)) { | ||
if (isRef(attr.ref)) { | ||
attr.ref.current = node | ||
} else if (isFunction(attr.ref)) { | ||
attr.ref(node) | ||
} | ||
return node | ||
@@ -356,3 +364,6 @@ } | ||
case "textContent": | ||
node[key] = value | ||
if (isVisibleChild(value)) { | ||
node[key] = value | ||
} | ||
return | ||
@@ -367,2 +378,12 @@ | ||
case "value": | ||
if (value == null || node instanceof window.HTMLSelectElement) { | ||
return | ||
} else if (node instanceof window.HTMLTextAreaElement) { | ||
node.value = value | ||
return | ||
} | ||
break | ||
case "spellCheck": | ||
@@ -493,2 +514,6 @@ node.spellcheck = value | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
const cache = new Map() | ||
@@ -529,5 +554,6 @@ | ||
var index = { | ||
Component, | ||
PureComponent: Component, | ||
createElement, | ||
Fragment, | ||
Component, | ||
} | ||
@@ -545,3 +571,5 @@ function preventDefault(event) { | ||
exports.Fragment = Fragment | ||
exports.PureComponent = Component | ||
exports.SVGNamespace = SVGNamespace | ||
exports.StrictMode = Fragment | ||
exports.className = className | ||
@@ -548,0 +576,0 @@ exports.createElement = createElement |
@@ -51,5 +51,2 @@ /* eslint-disable */ | ||
} | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
@@ -113,2 +110,19 @@ const SVGNamespace = "http://www.w3.org/2000/svg" | ||
appendChild(children, node) | ||
if (node instanceof window.HTMLSelectElement && attr.value != null) { | ||
if (attr.multiple === true && Array.isArray(attr.value)) { | ||
const values = attr.value.map(value => String(value)) | ||
node | ||
.querySelectorAll("option") | ||
.forEach(option => (option.selected = values.includes(option.value))) | ||
} else { | ||
node.value = attr.value | ||
} | ||
} | ||
if (isRef(attr.ref)) { | ||
attr.ref.current = node | ||
} else if (isFunction(attr.ref)) { | ||
attr.ref(node) | ||
} | ||
} else if (isFunction(tag)) { | ||
@@ -124,8 +138,2 @@ if (isObject(tag.defaultProps)) { | ||
if (isRef(attr.ref)) { | ||
attr.ref.current = node | ||
} else if (isFunction(attr.ref)) { | ||
attr.ref(node) | ||
} | ||
return node | ||
@@ -206,3 +214,6 @@ } | ||
case "textContent": | ||
node[key] = value | ||
if (isVisibleChild(value)) { | ||
node[key] = value | ||
} | ||
return | ||
@@ -217,2 +228,12 @@ | ||
case "value": | ||
if (value == null || node instanceof window.HTMLSelectElement) { | ||
return | ||
} else if (node instanceof window.HTMLTextAreaElement) { | ||
node.value = value | ||
return | ||
} | ||
break | ||
case "spellCheck": | ||
@@ -335,2 +356,6 @@ node.spellcheck = value | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
const cache = new Map() | ||
@@ -371,5 +396,6 @@ | ||
var index = { | ||
Component, | ||
PureComponent: Component, | ||
createElement, | ||
Fragment, | ||
Component, | ||
} | ||
@@ -387,3 +413,5 @@ function preventDefault(event) { | ||
exports.Fragment = Fragment | ||
exports.PureComponent = Component | ||
exports.SVGNamespace = SVGNamespace | ||
exports.StrictMode = Fragment | ||
exports.className = className | ||
@@ -390,0 +418,0 @@ exports.createElement = createElement |
{ | ||
"name": "jsx-dom-cjs", | ||
"version": "8.0.1-beta.2", | ||
"version": "8.0.1-beta.4", | ||
"description": "JSX to document.createElement.", | ||
@@ -14,3 +14,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"csstype": "^3.0.8" | ||
"csstype": "^3.0.9" | ||
}, | ||
@@ -17,0 +17,0 @@ "eslintIgnore": [ |
@@ -5,4 +5,2 @@ # jsx-dom | ||
[![build status](https://travis-ci.org/proteriax/jsx-dom.svg?branch=master)](https://travis-ci.org/proteriax/jsx-dom) | ||
[![dependency status](https://david-dm.org/proteriax/jsx-dom/status.svg)](https://david-dm.org/proteriax/jsx-dom#info=dependencies) | ||
[![devDependency status](https://david-dm.org/proteriax/jsx-dom/dev-status.svg)](https://david-dm.org/proteriax/jsx-dom#info=devDependencies) | ||
[![npm version](https://badge.fury.io/js/jsx-dom.svg)](https://badge.fury.io/js/jsx-dom) | ||
@@ -324,3 +322,3 @@ | ||
## API | ||
## API Compatibility with React | ||
The following functions are included for compatibility with React API: | ||
@@ -333,3 +331,3 @@ | ||
The following functions do **not** have memoization, and are only useful if you are | ||
The following functions do **not** have memoization or optimization, and are only useful if you are | ||
migrating from/to React. | ||
@@ -341,2 +339,5 @@ | ||
function useCallback<T extends Function>(fn: T, deps: any[]): T | ||
const StrictMode: React.FC | ||
class PureComponent {} | ||
``` | ||
@@ -343,0 +344,0 @@ |
Sorry, the diff of this file is too big to display
121035
3004
351
Updatedcsstype@^3.0.9