Comparing version 8.0.1-beta.3 to 8.0.1-beta.4
45
index.js
@@ -47,5 +47,2 @@ /* eslint-disable */ | ||
} | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
@@ -229,2 +226,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)) { | ||
@@ -240,8 +254,2 @@ if (isObject(tag.defaultProps)) { | ||
if (isRef(attr.ref)) { | ||
attr.ref.current = node | ||
} else if (isFunction(attr.ref)) { | ||
attr.ref(node) | ||
} | ||
return node | ||
@@ -365,2 +373,12 @@ } | ||
case "value": | ||
if (value == null || node instanceof window.HTMLSelectElement) { | ||
return | ||
} else if (node instanceof window.HTMLTextAreaElement) { | ||
node.value = value | ||
return | ||
} | ||
break | ||
case "spellCheck": | ||
@@ -491,2 +509,6 @@ node.spellcheck = value | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
const cache = new Map() | ||
@@ -527,5 +549,6 @@ | ||
var index = { | ||
Component, | ||
PureComponent: Component, | ||
createElement, | ||
Fragment, | ||
Component, | ||
} | ||
@@ -544,3 +567,5 @@ function preventDefault(event) { | ||
Fragment, | ||
Component as PureComponent, | ||
SVGNamespace, | ||
Fragment as StrictMode, | ||
className, | ||
@@ -547,0 +572,0 @@ createElement, |
@@ -47,5 +47,2 @@ /* eslint-disable */ | ||
} | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
@@ -109,2 +106,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)) { | ||
@@ -120,8 +134,2 @@ if (isObject(tag.defaultProps)) { | ||
if (isRef(attr.ref)) { | ||
attr.ref.current = node | ||
} else if (isFunction(attr.ref)) { | ||
attr.ref(node) | ||
} | ||
return node | ||
@@ -215,2 +223,12 @@ } | ||
case "value": | ||
if (value == null || node instanceof window.HTMLSelectElement) { | ||
return | ||
} else if (node instanceof window.HTMLTextAreaElement) { | ||
node.value = value | ||
return | ||
} | ||
break | ||
case "spellCheck": | ||
@@ -333,2 +351,6 @@ node.spellcheck = value | ||
function useMemo(factory) { | ||
return factory() | ||
} | ||
const cache = new Map() | ||
@@ -369,5 +391,6 @@ | ||
var index = { | ||
Component, | ||
PureComponent: Component, | ||
createElement, | ||
Fragment, | ||
Component, | ||
} | ||
@@ -386,3 +409,5 @@ function preventDefault(event) { | ||
Fragment, | ||
Component as PureComponent, | ||
SVGNamespace, | ||
Fragment as StrictMode, | ||
className, | ||
@@ -389,0 +414,0 @@ createElement, |
{ | ||
"name": "jsx-dom", | ||
"version": "8.0.1-beta.3", | ||
"version": "8.0.1-beta.4", | ||
"description": "JSX to document.createElement.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119527
2964
351