Skip to content

Commit f7dbbf7

Browse files
committed
feat(wx-react-native): 添加AppState NativeAppEventEmitter的not support 说明
1 parent 7d55920 commit f7dbbf7

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

packages/wx-react-native/miniprogram_dist/api/Platform.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
*/
88

99
export default {
10-
OS: 'wx'
10+
OS: 'wx',
11+
select: (obj) => {
12+
return obj.wx
13+
}
1114
}

packages/wx-react-native/miniprogram_dist/index.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ const TimePickerAndroid = getNotSupport('TimePickerAndroid')
5858
const ToastAndroid = getNotSupport('ToastAndroid')
5959
const ToolbarAndroid = getNotSupport('ToolbarAndroid')
6060

61+
const AppState = {
62+
removeEventListener: () => {
63+
console.warn('not support AppState now!')
64+
},
65+
addEventListener: () => {
66+
console.warn('not support AppState now!')
67+
}
68+
}
69+
const NativeAppEventEmitter = {
70+
addListener: () => {
71+
console.warn('not support NativeAppEventEmitter now! use @areslabs/wx-eventemitter instead')
72+
return () => {
73+
console.warn('not support NativeAppEventEmitter now! use @areslabs/wx-eventemitter instead')
74+
}
75+
},
76+
}
77+
6178
export {
6279
WXButton,
6380
WXView,
@@ -103,7 +120,9 @@ export {
103120
alert,
104121
requestAnimationFrame,
105122
cancelAnimationFrame,
106-
unstable_batchedUpdates
123+
unstable_batchedUpdates,
124+
AppState,
125+
NativeAppEventEmitter
107126
}
108127

109128
export default {
@@ -152,5 +171,7 @@ export default {
152171
alert,
153172
requestAnimationFrame,
154173
cancelAnimationFrame,
155-
unstable_batchedUpdates
174+
unstable_batchedUpdates,
175+
AppState,
176+
NativeAppEventEmitter
156177
}

packages/wx-react-native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@areslabs/wx-react-native",
3-
"version": "1.0.20",
3+
"version": "1.0.22",
44
"description": "微信版本的React Native",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)