Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to set a region with useFunctions() #267

Answered by elliotcw
jeff-kroot asked this question in Q&A
Discussion options

Currently, we have to do the following to specify the region with useFunctions():

const functions = useFunctions();
functions.region_ = 'europe-west1';

This does not seem like the way it should work (also seeing it's undocumented).

Maybe something like the following:

const functions = useFunctions('europe-west1');
// or
const functions = useFunctions()('europe-west1');
// or
const functions = useFunctions({ region: 'europe-west1'});
You must be logged in to vote

This fix has changed as of around "firebase": "^7.24.0",. _region has change to just region.

const functions = useFunctions();
functions.region = 'europe-west1';

Replies: 1 comment 2 replies

Comment options

This fix has changed as of around "firebase": "^7.24.0",. _region has change to just region.

const functions = useFunctions();
functions.region = 'europe-west1';
You must be logged in to vote
2 replies
Comment options

Is there a way to do this globally?

Comment options

You can export your own hook.

// app/hooks.ts
export const useAppFunctions = () => getFunctions(useFirebaseApp(), 'europe-west1');
Answer selected by jamesdaniels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #267 on December 10, 2020 00:44.

AltStyle によって変換されたページ (->オリジナル) /