Skip to content

Commit

Permalink
feat(wx-react-native): 添加AppState NativeAppEventEmitter的not support 说明
Browse files Browse the repository at this point in the history
  • Loading branch information
ykforerlang committed Jul 10, 2019
1 parent 7d55920 commit f7dbbf7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/wx-react-native/miniprogram_dist/api/Platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
*/

export default {
OS: 'wx'
OS: 'wx',
select: (obj) => {
return obj.wx
}
}
25 changes: 23 additions & 2 deletions packages/wx-react-native/miniprogram_dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ const TimePickerAndroid = getNotSupport('TimePickerAndroid')
const ToastAndroid = getNotSupport('ToastAndroid')
const ToolbarAndroid = getNotSupport('ToolbarAndroid')

const AppState = {
removeEventListener: () => {
console.warn('not support AppState now!')
},
addEventListener: () => {
console.warn('not support AppState now!')
}
}
const NativeAppEventEmitter = {
addListener: () => {
console.warn('not support NativeAppEventEmitter now! use @areslabs/wx-eventemitter instead')
return () => {
console.warn('not support NativeAppEventEmitter now! use @areslabs/wx-eventemitter instead')
}
},
}

export {
WXButton,
WXView,
Expand Down Expand Up @@ -103,7 +120,9 @@ export {
alert,
requestAnimationFrame,
cancelAnimationFrame,
unstable_batchedUpdates
unstable_batchedUpdates,
AppState,
NativeAppEventEmitter
}

export default {
Expand Down Expand Up @@ -152,5 +171,7 @@ export default {
alert,
requestAnimationFrame,
cancelAnimationFrame,
unstable_batchedUpdates
unstable_batchedUpdates,
AppState,
NativeAppEventEmitter
}
2 changes: 1 addition & 1 deletion packages/wx-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@areslabs/wx-react-native",
"version": "1.0.20",
"version": "1.0.22",
"description": "微信版本的React Native",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f7dbbf7

Please sign in to comment.