nihgwu / react-native-dva-starter Goto Github PK
View Code? Open in Web Editor NEWa React Native starter powered by dva and react-navigation
a React Native starter powered by dva and react-navigation
在新添一个tab后就报错,不知为何,google没搜到这个问题,
只在react-navigation看到这个issue1408
但还是不知道怎么解决,求助~
const HomeNavigator = TabNavigator(
{
Home: { screen: Home },
Account: { screen: Account },
Msg: { screen: Msg}, //新添一个tab
},
{
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
swipeEnabled: false,
animationEnabled: false,
lazyLoad: true,
},
)
hi:
i found one wired thing here, when i take DrawerNavigator as the root navigator, not the stackNavigator, the drawerNavigator will does not work as it expected!
the issue is when i click one of the drawer item, thing happened, not go to the corresponding page maped to the drawerNavigator!
is somethign i missed or ?
git clone and npm install repo , react-native run-ios report as follows 'ExceptionsManager.js:63 Cannot read property 'routes' of undefined'
不是个bug,就是求大神帮忙接解决一个问题,查了半天了
例如我想订阅一个页面被调用
react-native-dva-starter/app/index.js
Line 9 in 42253ae
now the react-navigation latest version is 2.0.1, can you update example? thanks!
`
Unpacking /Users/kalaliu/.rncache/boost_1_63_0.tar.gz...
tar: (Empty error message)
tar: Error exit delayed from previous errors.
Command /bin/sh failed with exit code 1
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze /Users/kalaliu/temp/react-native-dva-starter/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
Analyze /Users/kalaliu/temp/react-native-dva-starter/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
(2 commands with analyzer issues)
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/kalaliu/temp/react-native-dva-starter/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/DvaStarter.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/DvaStarter.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
`
现在需要在导航栏右侧加一个按钮。
_onDrawerOpenHide() { this._drawer.Open(); }
componentDidMount() { this.props.navigation.setParams({ navigatePress: this._onDrawerOpenHide }) }
用这种方式获取不了
navigation.state.params.navigatePress()
请问有什么好的解决方案吗?
cli工具在https://github.com/danmin25/dva-native-cli,后续会持续更新和改进,另外container目录里面的loading组件是不是作为组件放在components目录里面更为合适?
请问 RN + dva-core + react-navigation 的组合能否像 react + dva 那样实现动态加载model和routes?
如何实现?
点击按钮没有任何反应,但用remote-redux-devtools查看相关state是有改变的
Yarn version:
1.5.1
Node version:
8.9.1
Platform:
win32 x64
[2/4] Fetching packages...
error An unexpected error occurred: "https://codeload.github.com/react-navigation/react-native-tab-view/tar.gz/36ebd834d78b841fc19778c966465d02fd1213bb: connect ETIMEDOUT 54.251.140.56:443".
In this starter, I provide a router model to control the default action flow of react-navigation to workaround a known issue. If you don't need this, the integration will be much simpler, you can simply remove the router model and pass routerReducer to extraReducer of dva extraReducers: { router: routerReducer }. Read Redux Integration and dva's API for more information.
如果用router model, Drawer -> this.props.navigation.dispatch(DrawerActions.toggleDrawer()) 会不起作用
感谢回复,我将附件中红框的代码调换了位置,Login页面只闪现了一下就自己跳到home页了,我想知道在route.js中怎么添加一个页面在home页前面,Login不要是react-navigation的中页面,单独的页面,感谢回复,万分谢谢。
const AppNavigator = StackNavigator(
{
//Login: { screen: Login },
//Main: { screen: MainNavigator },
Login: { screen: Login },
Main: { screen: MainNavigator },
},
redux-persist v5 support new use cases :
不胜感激
They added...
import {
createReduxBoundAddListener,
createReactNavigationReduxMiddleware,
} from 'react-navigation-redux-helpers';
should update and do some modification, Thanks
this.props.navigation.popToTop();
好像是升级了react-navigation v2的原因。
您好,请问一下,在哪能找到类似 images 里面 houst.png 这样的图标文件?
Change react-native start-ios => react-native run-ios
@nihgwu, 可否在这个starter里添加CRUD供我们这些初学者参考? RN还是有很多地方和web不一样. 谢谢
目前用的是FlatList组件,配合 dva实现了下拉刷新和上拉加载,但是有各种问题。
尤其是下拉上拉的时候会提示 key 重复的错误,但是设置的 key 并没有重复
"dva": "1.3.0-beta.4",
"react": "16.0.0-alpha.12",
这个版本的dva要求的是15.X的版本,这样会导致安装不了
steps:
1.clone the code from git,
2.npm i &react-native link
3.add keystore to android and change configuration
4. cd android & ./gradlew aR ==>successful
5.change the android/app/build.gradle
def enableProguardInReleaseBuilds = false
to
def enableProguardInReleaseBuilds = true
Note: the configuration keeps the entry point 'okio.ForwardingSource { ForwardingSource(okio.Source); }', but not the descriptor class 'okio.Source'
Note: the configuration keeps the entry point 'okio.ForwardingSource { long read(okio.Buffer,long); }', but not the descriptor class 'okio.Buffer'
Note: there were 2 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 676 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 7 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 1 accesses to class members by means of introspection.
You should consider explicitly keeping the mentioned class members
(using '-keep' or '-keepclassmembers').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning: there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
例子运行起来了,怎样在首页前再加一个页面,我想加一个登陆页面然后点击跳转再加载到主页面,工程中怎样添加一个页面?dva的实现还不是太明白,烦请回复,谢谢。
直接run-android
报错FAILURE: Build failed with an exception.
。而用Expo XDE也不行,说Missing app.json
,往里面加入对应expo信息后又报Cannot find module 'D:\Coding\work\...\node_modules\expo\tools\LogReporter'
。然后就卡在这里了。
如何才能用expo预览应用,或者还有其他什么方式能方便开发时预览?
Just like what you wrote in app.js,Login successfully, jump to the home page,But I have no use for this method。
I wonder why you use longer form:
import {NavigationActions} from 'react-navigation'
...
this.props.dispatch(NavigationActions.navigate({routeName: 'HomeScreen'}));
Is there a problem with the code below?
this.props.navigation.navigate('HomeScreen');
Do we really need, importing NavigationActions
for each time we need navigation
如何根据user的login状态跳转登录页或者主页
1.npm install;
2.react-native run-android
按上述步骤执行完后,报错deviceInfo native module is not installed correctly,请问是什么原因?
点登录,在登录就会报错了
你好,以下是出错的信息,谢谢!
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants [email protected]
npm ERR! peerinvalid Peer [email protected] wants [email protected]
npm ERR! peerinvalid Peer [email protected] wants react@*
npm ERR! peerinvalid Peer [email protected] wants react@^15.4.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.