leecade / leecade/react-native-swiper
dynamic views
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Which OS ?
Both
Version
Latest
Expected behaviour
Add new component without recreate any other component
Actual behaviour
Everytime when I add dynamic components to Swiper all the old components are recreated.
My issue is about dynamic views.
I have a component called Table inside a Swiper. According to some events on my component the system will add more tables to Swiper but when it happens all the components added are recreated but I need to add news components to the swiper keeping the state of the components already added.
example code:
render() {
return (
<Swiper loop={false} showsPagination={false} showsButtons={false}>
{this.tables.map((item,key)=>{
return (<View key={item.id} style={{flex: 1}}><Table
game_id = {item.game_id}
name={item.name}
id={item.id}
button={item.button}
lateEnter={item.lateEnter}
mynavigation={item.mynavigation}/></View>)
})}
</Swiper>
);
}
};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the render method shown, especially the tables.map output passed to Swiper and the nested Table components. Trace how adding an item changes the rendered views and determine whether existing Table state is preserved; done means new tables appear without recreating the previously added components.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100