mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Add useFormStatus to server rendering stub (#26788)
This was an oversight when I set up the hook in #26719.
This commit is contained in:
+1
@@ -22,4 +22,5 @@ export {
|
||||
preconnect,
|
||||
preload,
|
||||
preinit,
|
||||
experimental_useFormStatus,
|
||||
} from './src/server/ReactDOMServerRenderingStub';
|
||||
|
||||
@@ -81,4 +81,16 @@ describe('react-dom-server-rendering-stub', () => {
|
||||
);
|
||||
expect(x).toBe(false);
|
||||
});
|
||||
|
||||
// @gate enableFormActions
|
||||
// @gate enableAsyncActions
|
||||
it('exports experimental_useFormStatus', async () => {
|
||||
function App() {
|
||||
const {pending} = ReactDOM.experimental_useFormStatus();
|
||||
return 'Pending: ' + pending;
|
||||
}
|
||||
|
||||
const result = await ReactDOMFizzServer.renderToStaticMarkup(<App />);
|
||||
expect(result).toEqual('Pending: false');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
export {preinit, preload, preconnect, prefetchDNS} from '../ReactDOMFloat';
|
||||
export {useFormStatus as experimental_useFormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions';
|
||||
|
||||
export function createPortal() {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user