Comments (7)
We could make some improvements in documentation. Make it "easy to read". Highlight the important things (like this one :))
from react-native-material-ui.
stupid of me :( should have really read the documentation, what an idiot
from react-native-material-ui.
@AbdoulayeKarimTraore
So what did you miss?
I have the same problem "Undefined is not an object (context.uiTheme.ActionButton)"
Any ideas?
from react-native-material-ui.
@KevinHu2014 all the components expect a uiTheme object to be present in the context, this is obtained by wrapping the component with à themeprovider component as described in the usage section of the readme, or even better wrapping the main component of your app with the themeprovider so that the uiTheme object is available in the context for all the over components, carefully read the readme, its not extremely evident at first glance, if you have further questions feel free to hl me, I'll post code snippets for you
from react-native-material-ui.
@aktraore Could you post a code snippet, please?
from react-native-material-ui.
Actually I stuck on the same problem and only notice the cause when I read @aktraore explanation. I read the readme but as @aktraore said it is not really clear that I should use wrap the component with ThemeProvider. Maybe highlight or explicitly write about it on the readme @xotahal ?
from react-native-material-ui.
@rostyys sorry for the delay, I must have missed the email, here is a snippet in which I wrap the main component of my app with a theme provider that's available to all the components, I'm using react-native-router flux for the routing and redux but that's not the main point, if you have any questions hl me
'use strict';
import React, { Component } from 'react';
import {
StyleSheet,
ScrollView
} from 'react-native';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { ActionCreators } from './redux/actions';
function mapDispatchToProps(dispatch) {
return bindActionCreators(ActionCreators, dispatch);
}
import { Scene, Router, Actions } from 'react-native-router-flux';
import { ThemeProvider } from 'react-native-material-ui';
import StartingPage from './starting_page/StartingPage';
import Login from './login/Login';
import ShareComponent from './share/ShareComponent';
import HangoutList from './hangout/HangoutList';
import NewHangout from './hangout/NewHangout';
import Hangout from './hangout/Hangout';
import EventList from './event/EventList';
import EventParameter from './event/EventParameter';
import EventInvitation from './event/EventInvitation';
import NewEvent from './event/NewEvent';
import EventInfo from './event/EventInfo';
import EventLocation from './event/EventLocation';
import PlaceInfo from './place/PlaceInfo';
import EventDateTimePicker from './event/EventDateTimePicker';
import Menu from './menu/Menu';
import { I18n, constants } from './common/I18n';
import PersonList from './person/PersonList';
import ChoiceList from './place/ChoiceList';
import EventMembers from './event/EventMembers';
import SearchFriends from './friends/SearchFriends';
import Friends from './friends/Friends';
const scenes = Actions.create(
<Scene key="root">
<Scene key='startingPage' component={StartingPage} initial={true} animation={'fade'} hideNavBar={true} />
<Scene key='login' component={Login} animation={'fade'} hideNavBar={true} />
<Scene key='menu' component={Menu} animation={'fade'} hideNavBar={true}/>
<Scene key='hangoutList' component={HangoutList} animation={'fade'} hideNavBar={true} />
<Scene key='hangout' component={Hangout} animation={'fade'} hideNavBar={true} />
<Scene key='newHangout' component={NewHangout} title={I18n.t(constants.NEW_HANGOUT)} animation={'fade'} hideNavBar={false} />
<Scene key='eventList' component={EventList} animation={'fade'} hideNavBar={false} />
<Scene key='newEvent' component={NewEvent} title={I18n.t(constants.NEW_EVENT)} animation={'fade'} hideNavBar={false} />
<Scene key='eventDateTimePicker' component={EventDateTimePicker} animation={'fade'} hideNavBar={false} />
<Scene key='shareComponent' animation={'fade'} component={ShareComponent} />
<Scene key='eventParameter' component={EventParameter} animation={'fade'} hideNavBar={false} />
<Scene key='eventInvitation' component={EventInvitation} animation={'fade'} hideNavBar={false} />
<Scene key='eventInfo' component={EventInfo} animation={'fade'} hideNavBar={true} />
<Scene key='eventLocation' component={EventLocation} animation={'fade'} hideNavBar={true} />
<Scene key='eventMembers' component={EventMembers} animation={'fade'} hideNavBar={false} />
<Scene key='placeInfo' component={PlaceInfo} animation={'fade'} hideNavBar={true} />
<Scene key="personList" component={PersonList} animation={'fade'} hideNavBar={false}/>
<Scene key="choiceList" component={ChoiceList} animation={'fade'} hideNavBar={false}/>
<Scene key="searchFriends" component={SearchFriends} animation={'fade'} hideNavBar={true}/>
<Scene key="friends" component={Friends} animation={'fade'} hideNavBar={false} />
</Scene>
);
class OutwegoApp extends Component {
render() {
return (
<ThemeProvider uiTheme={uiTheme}>
<Router
backAndroidHandler={() => false}
navigationBarStyle={styles.routerNavBar}
titleStyle={styles.routerNavBarTitle}
barButtonIconStyle={styles.routerBackButton}
scenes={scenes}
/>
</ThemeProvider>
)
}
}
const uiTheme = {
palette: {
primaryColor: '#f38d11',
},
drawerSectionActiveItem: {
container: {
backgroundColor: 'transparent',
}
},
}
const styles = StyleSheet.create({
routerNavBar: {
backgroundColor: 'transparent',
borderBottomColor: 'transparent'
},
routerNavBarTitle: {
color: '#f38d11'
},
routerBackButton: {
tintColor: '#f38d11'
}
});
export default connect(() => { return {} }, mapDispatchToProps)(OutwegoApp);
from react-native-material-ui.
Related Issues (20)
- componentWillReceiveProps has been renamed, and is not recommended for use
- Text attribute of button ignores last character randomly HOT 1
- Why is icon required in the bottom navigation action?
- AutoComplete is not working
- Radio Button Label not appearing in Modal
- ToolBar font error HOT 1
- Facing error while using theme
- Rework on colors and improve contrast issue
- Resovle vector icons to be animated
- How to use custom image in BottomNavigation.Action HOT 1
- Project discontinued? HOT 1
- follow-up development
- Changing toolbar color when in searchable mode (react-native-material-ui)
- how to change help text color(placeholdertext color) when seachable mode is on
- React Native UI
- please provide support for placeholdertextcolor in tool-bar HOT 2
- PropTypes are deprecated (and make the library crash with react-native-web) HOT 3
- add icon in searchable mode HOT 1
- BottomNavigationAction disabled with more features HOT 1
- on upgrading the RN to 0.70.6 of version 'ViewPropTypes' haven't use style, Text.propTypes.style ..properties , need update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-material-ui.