react-native-draganddrop-board icon indicating copy to clipboard operation
react-native-draganddrop-board copied to clipboard

Board data is not showing once loaded then going back again to the screen.

Open ariesbrylle-bms opened this issue 4 years ago • 8 comments

Here's how to replicate the issue:

  1. Go to board screen: Board is successfully loaded. image

  2. Leave the board screen.

  3. Go back again to the board screen: Board is not loaded.

image

But once I reloaded the app, it's working again.

Here's my code for the creation and updating of the board.

// create let boardRepository = new BoardRepository(); or let boardRepository = new BoardRepository([]);

// update useEffect(() => { if (boardData.length > 0) { console.log("should update data"); boardRepository.updateData(boardData); } }, [boardData]);

Note: it always logged "should update data" so it means that there's data that should be loaded.

ariesbrylle-bms avatar Jan 02 '21 00:01 ariesbrylle-bms

When I console log the board data, the map object has the items and its column item.

ariesbrylle-bms avatar Jan 02 '21 01:01 ariesbrylle-bms

Hi @TacticCoder, really need your help here. Thank you.

ariesbrylle-bms avatar Jan 17 '21 10:01 ariesbrylle-bms

Please post your code.

TacticCoder avatar Jan 17 '21 11:01 TacticCoder

Please post your code.

@TacticCoder

This is how I initialized my boardRepository

const boardRepository = new BoardRepository([]);

This is how I update the data

useEffect(() => { if (boardData.length > 0) { console.log("should update data"); boardRepository.updateData(boardData); } }, [boardData]);

And this is my component {boardData.length > 0 ? ( <Board boardRepository={boardRepository} open={(data) => { console.log(data); }} onDragEnd={(srcColumnId, destColumnId, draggedItem) => { console.log(srcColumnId, destColumnId, draggedItem.attributes.id); // console.log(state.info_boards[destColumnId - 1]); }} boardBackground={CONSTANTS.OFFICIAL_BG_COLOR} cardNameTextColor={CONSTANTS.PRIMARY_COLOR} cardIconColor={CONSTANTS.PRIMARY_COLOR} badgeBackgroundColor={CONSTANTS.PRIMARY_COLOR} columnNameTextColor={CONSTANTS.PRIMARY_COLOR} emptyIconColor={CONSTANTS.PRIMARY_COLOR} emptyText="No Issue on this Board." ref={boardRef} /> ) : ( <View style={{ height: "100%" }}> <Text>No Board</Text> </View> )}

ariesbrylle-bms avatar Jan 17 '21 13:01 ariesbrylle-bms

Were you able to replicate the issue @TacticCoder ? :)

ariesbrylle-bms avatar Jan 21 '21 11:01 ariesbrylle-bms

hi @TacticCoder same issue , Have you solved this problem yet ? @ariesbrylle-bms

cenaHara avatar Jan 23 '21 04:01 cenaHara

hi @TacticCoder same issue , Have you solved this problem yet ? @ariesbrylle-bms

No, I wasn't able to solve the problem yet.

If I initialized the board like this

<Board boardRepository={new BoardRepository(boardData)} open={(data) => { }}

    />

I experience this issue https://github.com/bear-junior/react-native-draganddrop-board/issues/19

However, I used my code above (comments above) I experience this issue.

ariesbrylle-bms avatar Jan 23 '21 04:01 ariesbrylle-bms

Hello, any help please :) Thank you. I really can't figure out what's wrong with it :)

ariesbrylle-bms avatar Feb 14 '21 07:02 ariesbrylle-bms