mdbootstrap / TW-Elements-React

TW Elements for React - 𝙃𝙪𝙜𝙚 collection of Tailwind + React components, sections and templates 😎
https://tw-elements.com/docs/react/
MIT License
139 stars 27 forks source link

Docs: Next Integration - location of react components #174

Open iurii-kyrylenko opened 4 months ago

iurii-kyrylenko commented 4 months ago

From documentation:

Step 7 Go to the src/pages folder and create a new, standalone file with name of your component (for example MyComponent.tsx).

This does't work in App Router mode. The production build (npm run build) fails with error:

 TypeError: Cannot read properties of undefined (reading 'forwardRef')

I think that correct place for the MyComponent.tsx is the src/components folder.

iprzybysz commented 4 months ago

Hi, it can be a workaround for now. If some of our components have a problem with forwardRef during the build, you can create a component for them.

iurii-kyrylenko commented 4 months ago

Hi, it can be a workaround for now. If some of our components have a problem with forwardRef during the build, you can create a component for them.

Thank you, @iprzybysz

iurii-kyrylenko commented 4 months ago

you can create a component for them.

@iprzybysz, Do you mean: you can create an issue for them?

iprzybysz commented 4 months ago

You could organize it by placing it in the src/components directory, and create components there that encapsulate specific TWE component.