type__error’s avatartype__error’s Twitter Archive—№ 12,826

      1. Typescript: how do I tell it "if there is no children prop, require this other prop"? My type isn't working: { children?: never; screenReaderText: string; } | { children: React.ReactNode | string | Element; screenReaderText?: string; }
    1. …in reply to @type__error
      I'm assuming because ReactNode can be null or undefined. Components that don't have children OR screenReaderText aren't resulting in errors.
  1. …in reply to @type__error
    Nope, it's because the component is a forwarded ref 🙃