Giter Club home page Giter Club logo

Comments (7)

ljharb avatar ljharb commented on May 30, 2024

Can you share the code that this crashed on?

from jsx-ast-utils.

quisido avatar quisido commented on May 30, 2024

I don't think I still have it, but it was something like this:

function MyComponent(): ReactElement {
  const buttonProps: (Required<Attributes> & ButtonHTMLAttributes<HTMLButtonElement>)[]= [
    {
      children: 'test',
      key: 'test',
      onClick: (): void => {
        return;
      },
    },
  ];

  return <>
    {
      buttonProps.map(
        ({ key, ...props }: Required<Attributes> & ButtonHTMLAttributes<HTMLButtonElement>): ReactElement =>
          <button key={key} type="button" {...props} />
    }
  </>;
}

key may not have been destructured at the time of the crash, though; and the type prop may have been missing.

Sorry that I can't provide an exact copy. Hope this helps.

from jsx-ast-utils.

ljharb avatar ljharb commented on May 30, 2024

So you can't reproduce the crash anymore?

from jsx-ast-utils.

quisido avatar quisido commented on May 30, 2024

I haven't tried. I have since fixed it in my codebase and do not have the opportunity to re-break it. I was hoping the information in the OP was enough.

<button {...props} /> where props is Required<Attributes> & ButtonHTMLAttributes<HTMLButtonElement> is as specific as I can be for the time being.

from jsx-ast-utils.

ljharb avatar ljharb commented on May 30, 2024

Unfortunately the snippet above doesn't seem to parse.

from jsx-ast-utils.

ljharb avatar ljharb commented on May 30, 2024

ok, i was able to fix the parse error, but it passes on the latest eslint-plugin-react. Are you sure you've got the latest version of that, and jsx-ast-utils, installed?

from jsx-ast-utils.

ljharb avatar ljharb commented on May 30, 2024

This also seems like the same as #107, so I'll close, unless we can reproduce it. Thanks for filing!

from jsx-ast-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.