@@ -32,7 +32,7 @@ function getGlobalThis() {
3232 throw new Error ( 'unable to locate global object' )
3333}
3434
35- function setReactActEnvironment ( isReactActEnvironment ) {
35+ function setIsReactActEnvironment ( isReactActEnvironment ) {
3636 getGlobalThis ( ) . IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment
3737}
3838
@@ -43,7 +43,7 @@ function getIsReactActEnvironment() {
4343function withGlobalActEnvironment ( actImplementation ) {
4444 return callback => {
4545 const previousActEnvironment = getIsReactActEnvironment ( )
46- setReactActEnvironment ( true )
46+ setIsReactActEnvironment ( true )
4747 try {
4848 // The return value of `act` is always a thenable.
4949 let callbackNeedsToBeAwaited = false
@@ -64,24 +64,24 @@ function withGlobalActEnvironment(actImplementation) {
6464 then : ( resolve , reject ) => {
6565 thenable . then (
6666 returnValue => {
67- setReactActEnvironment ( previousActEnvironment )
67+ setIsReactActEnvironment ( previousActEnvironment )
6868 resolve ( returnValue )
6969 } ,
7070 error => {
71- setReactActEnvironment ( previousActEnvironment )
71+ setIsReactActEnvironment ( previousActEnvironment )
7272 reject ( error )
7373 } ,
7474 )
7575 } ,
7676 }
7777 } else {
78- setReactActEnvironment ( previousActEnvironment )
78+ setIsReactActEnvironment ( previousActEnvironment )
7979 return actResult
8080 }
8181 } catch ( error ) {
8282 // Can't be a `finally {}` block since we don't know if we have to immediately restore IS_REACT_ACT_ENVIRONMENT
8383 // or if we have to await the callback first.
84- setReactActEnvironment ( previousActEnvironment )
84+ setIsReactActEnvironment ( previousActEnvironment )
8585 throw error
8686 }
8787 }
@@ -203,6 +203,10 @@ function asyncAct(cb) {
203203}
204204
205205export default act
206- export { asyncAct , setReactActEnvironment , getIsReactActEnvironment }
206+ export {
207+ asyncAct ,
208+ setIsReactActEnvironment as setReactActEnvironment ,
209+ getIsReactActEnvironment ,
210+ }
207211
208212/* eslint no-console:0 */
0 commit comments