Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // что передаю как пропс
- function groupListCard() {
- cards.map(item => {
- let target = item.colors.length === 0 ?
- item.originalType || item.types[0] : item.colors[0]
- switch (target) {
- case "White":
- return cardsNoPriceWhite.push(item)
- case "Blue":
- return cardsNoPriceBlue.push(item)
- case "Green":
- return cardsNoPriceGreen.push(item)
- case "Black":
- return cardsNoPriceBlack.push(item)
- case "Red":
- return cardsNoPriceRed.push(item)
- case "Land":
- return cardsNoPriceLand.push(item)
- case "Artifact":
- return cardsNoPriceArtifact.push(item)
- default:
- return
- }
- })
- return {
- 0: cardsNoPriceWhite,
- 1: cardsNoPriceBlue,
- 2: cardsNoPriceBlack,
- 3: cardsNoPriceGreen,
- 4: cardsNoPriceLand,
- 5: cardsNoPriceRed,
- 6: cardsNoPriceArtifact
- }
- }
- // что передаю в родительском
- {checkPrint !== ''
- ?
- <CheckList groupListCard={groupListCard} />
- : null
- }
- // доча
- const CheckList = props => {
- const data = props.groupListCard()
- return (
- <>{
- (() => {
- for (let i = 0; i < data.length; i++) {
- switch (i) {
- case i === 0:
- console.log('test')
- break
- default: return
- }
- }
- })
- }</>
- )
- }
Add Comment
Please, Sign In to add comment