react/scripts
Andrew Clark 491aec5d61
Implement experimental_useOptimisticState (#26740)
This adds an experimental hook tentatively called useOptimisticState.
(The actual name needs some bikeshedding.)

The headline feature is that you can use it to implement optimistic
updates. If you set some optimistic state during a transition/action,
the state will be automatically reverted once the transition completes.

Another feature is that the optimistic updates will be continually
rebased on top of the latest state.

It's easiest to explain with examples; we'll publish documentation as
the API gets closer to stabilizing. See tests for now.

Technically the use cases for this hook are broader than just optimistic
updates; you could use it implement any sort of "pending" state, such as
the ones exposed by useTransition and useFormStatus. But we expect
people will most often reach for this hook to implement the optimistic
update pattern; simpler cases are covered by those other hooks.
2023-05-01 13:19:20 -04:00
..
babel Use .slice() for all substring-ing (#26677) 2023-04-19 14:26:01 -07:00
bench Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
circleci Add snapshot testing on e2e test failure (#24672) 2022-06-06 10:36:58 -07:00
devtools chore[devtools/release-scripts]: update messages / fixed npm view com… (#26660) 2023-04-19 10:05:16 +01:00
error-codes Implement experimental_useOptimisticState (#26740) 2023-05-01 13:19:20 -04:00
eslint [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
eslint-rules Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
flow Add `alwaysThrottleRetries` flag (#26685) 2023-04-20 14:23:22 -04:00
git Remove leftover env variable logic in pre-commit hook 2015-09-01 14:35:47 -07:00
jest Gate DevTools test to fix CI (#26742) 2023-04-29 11:14:16 -04:00
perf-counters [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
prettier Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
print-warnings Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
release Use .slice() for all substring-ing (#26677) 2023-04-19 14:26:01 -07:00
rollup Handle line endings correctly on Windows in build script for RN (#26727) 2023-04-25 17:26:34 +01:00
shared Split out Edge and Node implementations of the Flight Client (#26187) 2023-02-21 13:18:24 -05:00
tasks Bug: yarn flow dom does not exist, so console should suggest yarn flow dom-node (#26213) 2023-02-21 21:30:34 +01:00
authors AUTHORS 2013-09-09 23:42:54 -07:00