Comments (4)
Are you getting any errors here?
from react-native-elements.
@abhitheawesomecoder there are a couple issues with your code.
- The
Text
element needs to be wrapped within aView
container with a flex 1 and a backgroundColor as the default is transparent. - You are missing a toggle button on the view that actually opens/closes the Side Menu.
@afdalwahyu I would guess you have the same problem because you are using a similar code as @abhitheawesomecoder?
This should work for both you guys, try it out:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableHighlight
} from 'react-native';
import { SideMenu, List, ListItem } from 'react-native-elements';
import Icon from 'react-native-vector-icons/MaterialIcons'
export default class Element extends Component {
constructor () {
super()
this.state = { toggled: false }
}
toggleSideMenu () {
this.setState({
toggled: !this.state.toggled
})
}
render() {
// SideMenu takes a React Native element as a prop for the actual Side Menu
const list = [
{
name: 'Amy Farha',
avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg',
subtitle: 'Vice President'
},
{
name: 'Chris Jackson',
avatar_url: 'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg',
subtitle: 'Vice Chairman'
}
]
const MenuComponent = (
<View style={{flex: 1, backgroundColor: '#ededed', paddingTop: 50}}>
<List containerStyle={{marginBottom: 20}}>
{
list.map((item, i) => (
<ListItem
roundAvatar
onPress={() => console.log(item.avatar_url)}
avatar={{uri:item.avatar_url}}
key={i}
title={item.name}
subtitle={item.subtitle} />
))
}
</List>
</View>
)
return (
<SideMenu
MenuComponent={MenuComponent}
toggled={this.state.toggled}>
<View style={styles.container}>
<TouchableHighlight
style={{marginTop: 7, marginLeft: 9}}
onPress={this.toggleSideMenu.bind(this)}
underlayColor='transparent'>
<Icon
color='black'
name='menu'
size={28}
/>
</TouchableHighlight>
<Text style={styles.welcome}>Working Side Menu Example</Text>
</View>
</SideMenu>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
AppRegistry.registerComponent('Element', () => Element);
from react-native-elements.
No errors
On 07-Nov-2016 10:02 pm, "Nader Dabit" [email protected] wrote:
Are you getting any errors here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#76 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADwwThUBytz5XIKUpu7KzGAmjwAaGv2Fks5q71KkgaJpZM4KjSTO
.
from react-native-elements.
+1
I have same problem with Android 6.1
from react-native-elements.
Related Issues (20)
- React Native CLI invalid documentation link
- FAB when rendered on web Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>. HOT 4
- import { styled } from '@rneui/themed' doesn't work HOT 2
- Feature Request - Animated Shrink Button with Loading Indicator
- Avatar ignoring resize mode on initial load HOT 18
- ButtonGroup fails on iOS Expo Dev Client HOT 1
- Feature request - Circular progress component
- The documentation sidebar is not taking the correct height on mobile screens.
- The search glass is not available in Chrome browser
- Dialog.Title does not honor Dark mode text color HOT 3
- SpeedDial cant work in web platform,cuz ``` [...new Array(React.Children.count(children))]``` will returned ```[empty × 2]``` HOT 2
- NPM version missmatch for @rneui/themed's peerDeps/devDeps HOT 1
- Unable to import styled helper HOT 1
- ref prop is not working for Button component of New React native element lib (@rneui/base & @rneui/themed) HOT 2
- Upgrade Expo version for Expo demo HOT 1
- [Feature Request] For web renders, let `Icon` and `Chip` render as `<button>` only if it needs to be clickable HOT 1
- Latest @rneui/themed has incorrect peer and dev dependency HOT 1
- SearchBar has no Cancel button on iOS HOT 3
- TextProps are extended by ListItem.Content instead of ListItem.Title
- Show default image when source load fail 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-elements.