JSFiddle - React, Tailwind, and code Playground

by Vladymyr Shevchuk

JavaScript

const getGoBackLink = () => {
    let link;
    if (route.location.state?.prevLink) {
      link = route.location.state.prevLink;
    } else {
      link = props.isUpgrade ? ROUTES.upgradePack : ROUTES.businessPack;
    }

    return link;

  };
  
  const foo = () => {
      let link = route.location.state?.prevLink;
      
      if (props.isUpgrade) {
      	link = ROUTES.upgradePack;
      } else {
	      link = ROUTES.businessPack;
      }
      
      return link;
  }