Giter Site home page Giter Site logo

Comments (6)

steve-py96 avatar steve-py96 commented on May 27, 2024 1

Saw those issues too... which is why I was first doubting the error and assumed that I messed up configuring sth. xd

About versions and origins:

❯ npm ls jsx-ast-utils
######################
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  └── [email protected] deduped

from jsx-ast-utils.

steve-py96 avatar steve-py96 commented on May 27, 2024 1

I have some structure like this (cropping out the contextual most irrelevant)

const Component = () => {
  const [{ data, error }, loading, dispatch] = useStore(asyncSelector, shallow)

  useEffect(() => {
    dispatch({
      loading: 'loading',
    })

    loadData().then(([res_error, res_data]) =>
      dispatch((old) => ({
        loading: 'done',
        local: merge(old.local, {
          error: res_error,
          data: res_data,
        }),
      }))
    )
  }, [])

  if (loading !== 'done') return <Loading />
  if (error !== null) return <Error />

  return (
    <>
      <Link className={styles.link} href={data![0].url} target="_blank">
        text
      </Link>

      ...
    </>
  )
} 

The data![0].url in the href-prop is the issue here, commenting it out/replacing it with a hardcoded string hides the warning.

from jsx-ast-utils.

steve-py96 avatar steve-py96 commented on May 27, 2024 1

Woah that's hella weird, I was building a repro and first I was gonna slap myself cause it didn't throw me the warning, but apparently it only throws on interactive HTMLElements (just a guess after testing <button> and <a> yet), therefore this might be caused somewhere else... (was at least my guess before you just fixed this, you're sanic xd)

Thx for fixing ❤️ , I'll leave the repro link here anyway tho, else RIP the effort! :D
https://stackblitz.com/edit/vitejs-vite-cd1axh?file=src%2FApp.tsx&terminal=lint

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024 1

Luckily i was able to repro it just from that one line :-) we weren't handling bracketed member expressions, specifically.

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

What version of jsx-ast-utils are you using? v3.2.0 added support for TSNonNullExpression.

See #82, #108, #71.

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

hmm, very strange. any idea what code it's warning on?

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.