-
Notifications
You must be signed in to change notification settings - Fork 18
Description
First of all thanks for sharing such a nice library. It perfectly fits my use case.
I am facing a problem and unable to find a way out so raising this issue for help.
I am rendering the Seatmap component inside my component. My component accepts number of rows and columns from user as input and based on that it generates rows and pass to Seatmap. here is my function used for generating rows.
const computeRows = (nRow, nCol, disableCols, blanks) => {
let totalSeats = 1;
const rowMap = [];
for (let i = 0; i < nRow; i++) {
const rowSeats = [];
let blankSeats = [];
if (blanks) {
blankSeats = blanks[i + 1] ? blanks[i + 1] : [];
}
for (let j = 0; j < nCol; j++) {
if (disableCols.includes(j + 1) || blankSeats.includes(j + 1)) {
rowSeats.push(null);
} else {
rowSeats.push({ number: totalSeats });
totalSeats += 1;
}
}
rowMap.push(rowSeats);
}
return rowMap;
};
When the compoenet render the first time then it displays the layout perfectly, but when value of rows and columns are changed by user it doesn't reflect in layout. I tried debugging and noticed shouldComponentUpdate method is called with updated props in Seatmap but still layout is not updating based on my new rows. Is it something related to Immutable Js used in Seatmap component?
Thanks in advance!