Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

What is the best way to complete a registration based on a choice?

$
0
0

I am not sure what is the best way to insure the best way to complete a registration.

My register page is complete and redirects with a parameter perfectly, I have 3 types of users,

1- Normal user

After a Normal user register, I redirect them to the home page, I do not need anything more.

2- Artist

After the Artist register, I need more data.

3- Host

After the Host register, I still need more data.

But the data is completely different, I though I will benefit from a single page and use statements to render the rest using the type parameter, But I am not sure if it's the right thing to do.

Example:

<Button                onPress={handleSignUp}                marginVertical={sizes.s}                marginHorizontal={sizes.sm}                gradient={gradients.primary}                disabled={Object.values(isValid).includes(false) || isLoading}><Text bold white transform="uppercase">                  {isLoading ? '' : t('common.signup')}                  {isLoading && <ActivityIndicator size={'small'} />}</Text></Button>
const handleSignUp = useCallback(() => {  /*.    . No need to write the whole code for the sign up process    .*/  navigation.navigate('CompleteProfile', {    paramKey: type,  });});

What is the best approach?

  • Using a single page and go with a statement rendering and combine them with users table and seperate them using type variable?
  • Use a seperate pages and redirect Artist to ArtistCompleteProfile.tsx and Host to HostCompleteProfile.tsx to complete reteriving their data and use a single table for each one?
  • Your new Apporach..

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>