Skip to content

void-dom-elements-no-children checking every .createElement and crashing #1073

Closed
@daltones

Description

@daltones

I've just updated to v6.10.0 and enabled void-dom-elements-no-children.

It's crashing with this error:

TypeError: Cannot read property 'properties' of undefined
    at EventEmitter.CallExpression ([...]/eslint-plugin-react/lib/rules/void-dom-elements-no-children.js:121:28)
[...]

It happens with this simple code:

document.createElement('img');

So here is the first problem:

  • The rule thinks that every .createElement( is the React.createElement.

Now testing with the actual React:

import React from 'react';

React.createElement('img');

The rule will crash too.

Second problem:

  • The rule doesn't treat incomplete number of createElement's arguments (as while typing React.createElement()).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy