vtex-apps / rich-text

2 stars 9 forks source link

How import RichText #82

Open birnayt opened 2 years ago

birnayt commented 2 years ago

What are you trying to accomplish? Please describe. Hi, how can I import the RichText component?

I tried this: import RichText from "vtex.rich-text"

But i received this error:

image

I saw the rich-text code and found that this component is being used with an index.tsx and just one export default, so I don't know how to export without causing the preventFullImport error.

Thanks!

birnayt commented 2 years ago

Oh, I already found the answer =)

Captura de Tela 2022-04-28 às 12 44 33
fabionumai commented 11 months ago

Para mim funcionou como abaixo:

import { index as RichText } from "vtex.rich-text"

export default function olaMundo() {
  return (
    <div>
      <RichText text="Olá mundo" />
    </div>
  )
}
eltonleao commented 2 months ago

Para mim funcionou como abaixo:

import { index as RichText } from "vtex.rich-text"

export default function olaMundo() {
  return (
    <div>
      <RichText text="Olá mundo" />
    </div>
  )
}

aqui tbm finalmente

vlw @fabionumai !

gabrielmagevski commented 2 months ago

@eltonleao e @fabionumai salvaramm!! Estava passando pelo problema JSX element type 'RichText' does not have any construct or call signatures.ts(2604)

o import { index as RichText } resolveu tudo, haha. GRATO!!!