Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer error state from message text #123

Closed
joelvdavies opened this issue Nov 8, 2023 · 0 comments
Closed

Infer error state from message text #123

joelvdavies opened this issue Nov 8, 2023 · 0 comments

Comments

@joelvdavies
Copy link
Collaborator

e.g. In

  const [nameError, setNameError] = React.useState(false);
  const [nameErrorMessage, setNameErrorMessage] = React.useState<
    string | undefined
  >(undefined);

Remove

const [nameError, setNameError] = React.useState(false);

and instead infer the state using

nameErrorMessage !== undefined

See #80 (comment)

joshuadkitenge added a commit that referenced this issue Nov 17, 2023


* develop:
  requested changes
  fixed unit tests
  reverted changes that didn't work
  removed unneeded useState
  changed to camelcase function name
  requested interface changes #117
  country field moved in dialog #117
  requested changes
  fix tests #117
  changed address view #117
  requested changes #117
  simplified edit #73
  changed types to be | null #68
  change errors to use less states #123
  fixed unit tests #117
  made address field changes and updated tests accordingly #117
@github-project-automation github-project-automation bot moved this from In Progress to Done in Inventory Management System Dec 13, 2023
@joshuadkitenge joshuadkitenge moved this from Done to Archive in Inventory Management System Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Archive
Development

No branches or pull requests

2 participants