Skip to content
This repository has been archived by the owner on May 13, 2019. It is now read-only.

Support react 16(react-native 0.43) , findNodeHandle, FlatList and SectionList #248

Open
wants to merge 128 commits into
base: master
Choose a base branch
from

Conversation

flyskywhy
Copy link
Contributor

@flyskywhy flyskywhy commented May 9, 2017

react 16:
(Chinese version comment of commit 8c543ba) react-native 0.43 对应的 react 的版本是 16.0.0-alpha.6 ,由于 react@16.0.0-alpha.6 中的 ReactBaseClasses.js 中的 setState 调用 enqueueSetState() 的参数与 react-dom@15.4.2 中
的 ReactUpdateQueue.js 中的 enqueueSetState() 定义配合不上,因此需要升级 react-dom 以使 Web 版的 Navigator 的页面 route 跳转再次能用,这实际上就是让 setState(partialState, callback) 中的 callback 再次能用。而之所以只升级成 react-dom@16.0.0-alpha.2 而非 react-dom@16.0.0-alpha.6 是因为 ReactAnimated 所用的第三方组件 animated 现在还不支持 React v16 Support 而使得从 react-dom@16.0.0-alpha.3 到 react-dom@16.0.0-alpha.6 都会导致崩溃,所以现在先暂时锁定在唯一能用的 react-dom@16.0.0-alpha.2

另:@yuanyan 后续是否考虑进行类似 necolas/react-native-web@941c628 这样的去除一些对 react-dom 依赖的操作?就像 necolas 在 React v16 Support 中建议 https://github.com/animatedjs/animated/blob/master/src/targets/react-dom.js 中的 var CSSPropertyOperations = require('react-dom/lib/CSSPropertyOperations'); 语句去除对 react-dom 的依赖那样

https://github.com/react-community/react-navigation:
work with react-navigation recommended by react-native@0.44.0(it remove navigator) when
use
import { StackNavigator } from 'react-navigation/src/react-navigation.js'
not
import { StackNavigator } from 'react-navigation'; // it will use react-navigation.web.js instead

and replace PlatformHelpers with PlatformHelpers.native in react-navigation/src/createNavigationContainer.js

findNodeHandle:
FlatList need it

FlatList and SectionList:
ported from react-native@0.43.3

flyskywhy added 5 commits May 9, 2017 09:53
we set react-dom@16.0.0-alpha.2 but not react-dom@16.0.0-alpha.6 is:

1. react@16.0.0-alpha.6 -> ReactBaseClasses.js -> setState -> enqueueSetState()
is not compatible with the parameters defined in react-dom@15.4.2 ->
ReactUpdateQueue.js -> enqueueSetState(), so we need upgrade react-dom, othewise
navigator can't route to new page because it use setState;

2. ReactAnimated use animated, but animated has not suppor React v16 for now, see
animatedjs/animated#63 , and react-dom@16.0.0-alpha.3
to react-dom@16.0.0-alpha.6 will crash the animated but accurate
react-dom@16.0.0-alpha.2 is good.
use
    import { StackNavigator } from 'react-navigation/src/react-navigation.js'
not
    import { StackNavigator } from 'react-navigation'; // it will use react-navigation.web.js instead

and replace PlatformHelpers with PlatformHelpers.native in react-navigation/src/createNavigationContainer.js
@cpunion
Copy link

cpunion commented May 26, 2017

@flyskywhy 看起来这个库放弃维护了,有动力接手继续吗?

@flyskywhy
Copy link
Contributor Author

@cpunion ,谢谢信任 😄 ,您的 PR 已合并

@flyskywhy
Copy link
Contributor Author

@fov42550564 ,issue 暂时还是先集中在这边吧,我也会时不时过来看看的

@fov42550564
Copy link
Contributor

fov42550564 commented Jun 29, 2017

@flyskywhy FlatList不能下拉刷新,设置refreshing={true}后,activityindicator也不能显示出来,onRefresh={()=>{console.log("========");}}函数也不执行,你测试的时候遇到这个问题了吗,另外,老版本的ListView设置refreshControl也不能下来刷新,是不是需要采用第三发的List?

@cpunion
Copy link

cpunion commented Jun 29, 2017

咱们 fork 一个共同维护吧,以这边的情况看,不但基本修复合并不了,以后发展也没指望了。

@fov42550564
Copy link
Contributor

@flyskywhy fork 吧

chenwenyu and others added 30 commits January 18, 2018 08:48
suppress Warning:Unknown props on FlatList
support onPress WebView
fix scrollEventThrottle bug
AsyncStorage:worked well
…rue` even after warning "Falling back to JS-based animation"
…crollIndicator; 'auto' is better than 'scroll'
    1. if still position: absolute , problem 1 in taofed#101 still exist
    when use ScrollView with DrawerItems of react-navigation even manually specify the height of ScrollView
    2. this padding workaround is the result of  position: absolute, so revert it too
…to set an indexed property on 'CSSStyleDeclaration': Index property setter is not supported.`
… react-native@0.59.10 for [Expose less internals for TestUtils](facebook/react#13539)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants