Below is a small React code fragment with a deterministic scenario. You need to determine the exact stdout line that the program will print after all actions complete.
Requirements
- Assume the code runs once and without
StrictMode effect re-invocations.
- The answer must be one exact stdout line in full, including
| and spaces.
- Nothing needs to be fixed: you only need to compute the final output for the given
after code.
Reproduction
- Run the file as a React app in the browser.
- When the component mounts, it immediately:
- performs optimistic deletion of tag
b;
- then performs optimistic deletion of tag
c;
- the first request ends in error;
- the second request ends successfully.
- After both requests finish, one final line is printed to the console.
Expected behavior
- You need to determine exactly which list of tags remains by the time of the final
console.log.
- Take into account that the rollback in the error handler uses a previously saved state snapshot.