약간의 해결 방법으로 가능합니다.
static navigationOptions = {
header: (navigation) => {
return <HomeViewTitle />;
}
}
을 한 다음에 연결할 수 있습니다 : 난 그냥 같이 헤더에 새 구성 요소를 사용해야 하나 내가
:-)이 좋은 기능을 호출 할이 해결 방법을 호출 할 것이다 REDUX 상태 내 경우 HomeViewTitle : 다음
import React, { Component } from 'react';
import {
View,
Text
} from 'react-native';
import { connect } from 'react-redux';
class HomeViewTitle extends Component {
render() {
return (
<View style={{height: 64, backgroundColor: '#000000', alignItems: 'center', justifyContent: 'center', paddingTop: 20}}>
<Text style={{color: '#FFFFFF', fontSize: 17, fontWeight: 'bold'}}>Home</Text>
</View>
);
}
}
const mapStateToProps = (state) => {
return state;
}
export default connect(mapStateToProps)(HomeViewTitle);
당신이 HomeViewTitle의 소품 같은 REDUX 상태를 가지고 동적 헤더를 설정할 수 있습니다
무엇에 대한 반응 헬멧 REDUX에 연결을? –