cht8687 / react-listview-sticky-header Goto Github PK
View Code? Open in Web Editor NEWreact listview with sticky section header
react listview with sticky section header
` const [posts,setPosts] = useState([]);
useEffect(() => {
db.collection("posts").onSnapshot((snapshot)=>
setPosts(snapshot.docs.map((doc)=>({id:doc.id,data:doc.data()})))
);
}, [])`
const MyAccountfunc= async ({navigation})=>{
let user = await AsyncStorage.getItem('user'); //it is showing error here
alert(user); //my user contains one mail
if(user==null)
{
alert('Login first')
navigation.navigate('Login')
}
else{
alert('done')
navigation.navigate('MyAccount')
}
return null
}
const DrawerNavigation = createDrawerNavigator(
{
"Home": App,
"My Account": MyAccountfunc,
"Order History": OrderHistory,
"About us": Aboutus,
"Contact us": Contactus,
"Logout": LogoutFunc
},
{
initialRouteName: "Home",
contentOptions: {
activeTintColor: "red"
}
}
);
export default createAppContainer(DrawerNavigation);
At the moment, if data array is long enough, the headers are not sticking to the correct position.
need to be fixed.
From the example, (with react 0.14)
Invariant Violation: Objects are not valid as a React child (found: object with keys {title}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of ListItem
.
position: sticky;
is quite popular especially on ios sofari.
Just noticed this line in the component unmount:
I'm thinking this should be 'detachEvent' ?
For those who has this error when why to npm install, just execute:
npm config set registry https://registry.npmjs.org/
when reaching end of list, just render it's head...
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.