Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REACT] Events do not render given a specific lifecycle sequence #7551

Open
chuckn0rris opened this issue Sep 22, 2023 · 0 comments
Open

[REACT] Events do not render given a specific lifecycle sequence #7551

chuckn0rris opened this issue Sep 22, 2023 · 0 comments
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer OEM OEM customer premium react React framework integration

Comments

@chuckn0rris
Copy link

Works well in vanilla

bryntum-reproduction.zip

Forum post

In React, when post-processing of backend responses is required, it is a very common pattern to use React.useMemo to memoize the results. For example

const processedEventsArray = React.useMemo(()=>{
    return rawResponse ? processServerResponse(rawResponse) : [];
}, [rawResponse]);

So on first run of the code, processedEventsArray is an empty array until the server response is received and processed. With this context, if the Scheduler is provided empty arrays for events/assignments/resources initially and then subsequently provided populated events and assignments first, then followed by resources, events are not rendered by the Scheduler. If the sequence is adjusted to resources array first, then events and assignments arrays, then the events are rendered. However since these are parallel async calls to backend, we are unable to guarantee the sequencing of data load.

Attached is a reproduction repo with both the working and non-working sequences of events.

@chuckn0rris chuckn0rris added bug Something isn't working react React framework integration premium forum Issues from forum large-account Reported by large customer OEM OEM customer labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer OEM OEM customer premium react React framework integration
Projects
None yet
Development

No branches or pull requests

1 participant