Does it matter if a function within a React component is not pure?

No problem, actually it's normal to reference directly state and some given props at your component's helper functions.

below, it is a little refactor, which is more of a matter of preference :)

  const getMessage = () => (
    accountData.frozen
      ? 'your account is frozen'
      : `you have ${accountData.savings} left in your account`
  )