Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created March 20, 2019 02:52
Show Gist options
  • Save iskenxan/4bcdb5cf46cfb1b4b241979a4b361ef9 to your computer and use it in GitHub Desktop.
Save iskenxan/4bcdb5cf46cfb1b4b241979a4b361ef9 to your computer and use it in GitHub Desktop.
addCard = (y) => {
const { cards } = this.state;
const newStack = [...cards];
const style = { ...styles.dropCard };
style.top = y;
const card = (
<view key="{y}" style="{style}">
<text>Sample</text>
</view>
)
newStack.push(card);
this.setState({ cards: newStack })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment