jsx-dom-cjs
Advanced tools
Comparing version 8.0.7 to 8.1.0
@@ -0,1 +1,8 @@ | ||
# 8.1.0 | ||
- Fixes #97: support `disabled` on `<link>` element. | ||
- Fixes #94: supports `forwardRef` and `useImperativeHandle`. | ||
- Fixes #68: exports more types. | ||
- Bumped TypeScript definition sync with `@types/react` at #e05c7e9. | ||
- Removes all `*Capture` event listener types. They were never supported. | ||
# 8.0.5 | ||
@@ -2,0 +9,0 @@ - Added support for using `DOMTokenList` (e.g. `element.classList`) for `className`. |
11
index.js
@@ -593,2 +593,11 @@ /* eslint-disable */ | ||
} | ||
function forwardRef(render) { | ||
return _ref => { | ||
let { ref, ...props } = _ref | ||
return render(props, ref ?? createRef()) | ||
} | ||
} | ||
function useImperativeHandle(ref, init) { | ||
attachRef(ref, init()) | ||
} | ||
@@ -660,2 +669,3 @@ const cache = /* @__PURE__ */ new Map() | ||
exports.default = index | ||
exports.forwardRef = forwardRef | ||
exports.h = createElement | ||
@@ -671,4 +681,5 @@ exports.isRef = isRef | ||
exports.useClassList = useClassList | ||
exports.useImperativeHandle = useImperativeHandle | ||
exports.useMemo = useMemo | ||
exports.useRef = createRef | ||
exports.useText = useText |
@@ -417,2 +417,11 @@ /* eslint-disable */ | ||
} | ||
function forwardRef(render) { | ||
return _ref => { | ||
let { ref, ...props } = _ref | ||
return render(props, ref ?? createRef()) | ||
} | ||
} | ||
function useImperativeHandle(ref, init) { | ||
attachRef(ref, init()) | ||
} | ||
@@ -484,2 +493,3 @@ const cache = /* @__PURE__ */ new Map() | ||
exports.default = index | ||
exports.forwardRef = forwardRef | ||
exports.h = createElement | ||
@@ -495,4 +505,5 @@ exports.isRef = isRef | ||
exports.useClassList = useClassList | ||
exports.useImperativeHandle = useImperativeHandle | ||
exports.useMemo = useMemo | ||
exports.useRef = createRef | ||
exports.useText = useText |
{ | ||
"name": "jsx-dom-cjs", | ||
"version": "8.0.7", | ||
"version": "8.1.0", | ||
"description": "JSX to document.createElement.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -343,3 +343,7 @@ # jsx-dom | ||
function createFactory(component: string): (props: object) => JSX.Element | ||
function useImperativeHandle<T>(ref: Ref<T>, init: () => T, deps?: DependencyList): void | ||
function useRef<T>(initialValue?: T): RefObject<T> | ||
function forwardRef<T = Node, P = {}>( | ||
render: (props: P, ref: Ref<T>) => ReactNode | ||
): FunctionComponent<P & { ref?: Ref<T> }> | ||
``` | ||
@@ -346,0 +350,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
3423
376
135033