Giter Club home page Giter Club logo

Comments (7)

ljharb avatar ljharb commented on May 30, 2024

Can you elaborate on when this happens, on what code?

from jsx-ast-utils.

pragmaticivan avatar pragmaticivan commented on May 30, 2024

I will try to dig deeper later to figure out which component is causing that. For now I added a check on .extract function to verify if the value is not undefined fist and it started working again.

from jsx-ast-utils.

pragmaticivan avatar pragmaticivan commented on May 30, 2024

I was able to figure out which part of the code is breaking. Doesn't seen to make a lot of sense.

<Link
          className={s.sortable}
          to={{
            pathname,
            query: {
              ...query,
              sort: `${sortKey}-${dir === 'asc' && isSorting ? 'desc' : 'asc'}`,
            },
          }}
        >
          {children}
</Link>

I fixed it by extracting the object inside to= to a new variable and passing the variable instead. It fixed the problem.

from jsx-ast-utils.

fender avatar fender commented on May 30, 2024

I had the same issue.

Before (errors):

<Link to={{
  pathname: '/sign-up',
  state: { ...get(this.props.location, 'state', {}) },
}} />

After (no errors):

const state = { ...get(this.props.location, 'state', {}) };
...
<Link to={{
  pathname: '/sign-up',
  state,
}} />

from jsx-ast-utils.

ljharb avatar ljharb commented on May 30, 2024

A PR would be great.

from jsx-ast-utils.

thisisthais avatar thisisthais commented on May 30, 2024

Can confirm that I had the same issue, also when attempting to spread an object in a ReactRouter Link component.

Before(errors):

<Link to={{ pathname: manageRoute, state: {...data}}>Manage</Link>

After(no errors):

const stateForLink = {...data};
...
<Link to={{ pathname: manageRoute, state: stateForLink}>Manage</Link>

Unfortunately I cannot share the full PR.

from jsx-ast-utils.

jessebeach avatar jessebeach commented on May 30, 2024

Fixed for realz in #75

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.