@ray-core/framework-shared
Advanced tools
Comparing version
@@ -6,14 +6,20 @@ # Change Log | ||
# [0.3.0-beta.6](https://registry.code.tuya-inc.top/godzilla/ray-core/compare/v0.2.9...v0.3.0-beta.6) (2023-05-24) | ||
# [0.3.0](https://registry.code.tuya-inc.top/godzilla/ray-core/compare/v0.2.10...v0.3.0) (2023-06-15) | ||
### Bug Fixes | ||
- 1. 修复 useModal 内容渲染未更新问题;2. 修复更新属性内容 html 标签映射问题 ([581a85f](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/581a85f12e8be21867933b89f13cfd1bfefb007c)) | ||
- 1. 修复 useModal 内容渲染未更新问题;2. 修复更新属性内容 html 标签映射问题 ([70f75e9](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/70f75e99fa4868b3f80494c2e6820c1519088570)) | ||
### Features | ||
- 新增 setInnerHTML hook,提供 innerHMLT 修改属性时机(主要是绑定事件时机) ([065098e](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/065098eb251bb12ab34092c0e648fd62162bebd1)) | ||
- add html tag 2 mini tag plugin hook ([511c30b](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/511c30b947b69ea70b65515281626b96410892f2)) | ||
- add html tag 2 mini tag plugin hook onCreateVirtualNode ([c6e9a91](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/c6e9a911c915d7c1e249084527e28e27d7231b0b)) | ||
- 新增 setInnerHTML hook,提供 innerHMLT 修改属性时机(主要是绑定事件时机) ([5f5f0fb](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/5f5f0fb80fea2dd894bd3a0000a20538b89129e6)) | ||
- add html tag 2 mini tag plugin hook ([7e991f5](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/7e991f5a98a81d3e1f009d92361aa19314851e88)) | ||
- add html tag 2 mini tag plugin hook onCreateVirtualNode ([e74bdbe](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/e74bdbe5f72d83f5fda64663f24912778159cf86)) | ||
## [0.2.10](https://registry.code.tuya-inc.top/godzilla/ray-core/compare/v0.2.9...v0.2.10) (2023-06-08) | ||
### Features | ||
- usePageEvent 支持动态添加 onPageScroll 生命周期 ([f2c70c4](https://registry.code.tuya-inc.top/godzilla/ray-core/commits/f2c70c46eb8c720834374f84d4bd8125a3d85117)) | ||
## [0.2.9](https://registry.code.tuya-inc.top/godzilla/ray-core/compare/v0.2.8...v0.2.9) (2023-05-17) | ||
@@ -20,0 +26,0 @@ |
@@ -30,4 +30,11 @@ "use strict"; | ||
var pageInstance = (0, react_1.useContext)(PageInstanceContext_1.default); | ||
var lifeCycle = (0, lifecycle_1.lifeCycleName)(eventName); | ||
(0, react_1.useLayoutEffect)(function () { | ||
// 涂鸦智能小程序页面实例的添加生命周期方法 | ||
if ('function' === typeof pageInstance.addLifecycle) { | ||
// 涂鸦智能小程序支持动态的添加 onPageScroll 生命周期 | ||
if (eventName === 'onPageScroll') { | ||
return pageInstance.addLifecycle(eventName, callback); | ||
} | ||
} | ||
var lifeCycle = (0, lifecycle_1.lifeCycleName)(eventName); | ||
return (0, lifecycle_1.registerLifecycle)(pageInstance, lifeCycle, callback); | ||
@@ -34,0 +41,0 @@ }); |
@@ -17,3 +17,3 @@ var __read = (this && this.__read) || function (o, n) { | ||
}; | ||
import { useLayoutEffect, useContext, useState, useEffect, useRef, cloneElement } from 'react'; | ||
import { cloneElement, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react'; | ||
import { lifeCycleName, registerLifecycle } from './lifecycle'; | ||
@@ -25,4 +25,11 @@ import PageInstanceContext from './PageInstanceContext'; | ||
var pageInstance = useContext(PageInstanceContext); | ||
var lifeCycle = lifeCycleName(eventName); | ||
useLayoutEffect(function () { | ||
// 涂鸦智能小程序页面实例的添加生命周期方法 | ||
if ('function' === typeof pageInstance.addLifecycle) { | ||
// 涂鸦智能小程序支持动态的添加 onPageScroll 生命周期 | ||
if (eventName === 'onPageScroll') { | ||
return pageInstance.addLifecycle(eventName, callback); | ||
} | ||
} | ||
var lifeCycle = lifeCycleName(eventName); | ||
return registerLifecycle(pageInstance, lifeCycle, callback); | ||
@@ -29,0 +36,0 @@ }); |
{ | ||
"name": "@ray-core/framework-shared", | ||
"version": "0.3.0-beta.6", | ||
"version": "0.3.0", | ||
"description": "使用真正的 React 构建跨平台小程序", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@ray-core/types": "0.3.0-beta.6", | ||
"@ray-core/types": "0.3.0", | ||
"@types/react": "^16.9.33", | ||
@@ -30,3 +30,3 @@ "@types/react-is": "^16.7.1", | ||
}, | ||
"gitHead": "3cc701c79be017b1f82579c000fe5d5ef1128542" | ||
"gitHead": "72c93f23bac373b387fd40c90b3bc7b76a451010" | ||
} |
110021
0.92%2304
0.61%