Galooshi / emacs-import-js

Emacs plugin for ImportJS
MIT License
40 stars 9 forks source link

Can I import a function which is written in a ts or tsx file #29

Closed nuymax closed 2 years ago

nuymax commented 4 years ago

I wrote a next-js page which displays a Example component.

pages/index.tsx

import Head from 'next/head'

export default function Home() {
  return (
    <>
      <Head>
        <title>Create Next App</title>
      </Head>
      <main>
        <Example />
      </main>
    </>
  )
}

And I put the components/Example.tsx like this.

export default function Example() {
  return (
    <div>
      <p>hello </p>
    </div>
  )
}

Then I want to import the Example component, and I run the M-x import-js-import at the index.ts buffer.

But I can't import the Example function.

Is it supported typescript?

kevinkehl commented 2 years ago

Sorry this was a while ago, but importjs now fully supports typescript. Let us know if there are any continuing issues.