You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can I use an external react component inside Docusaurus? #806
Could someone please tell me how to accomplish something like the following please? Essentially I can't have all my docs and my components be in the same directory cuz i have multiple apps in my project. Therefore I have a flex-docs folder, (which is essentially the docusaurus "website" folder) then I have a flex-plugins folder, a flex-webchat-ui folder, and aflex-lib folder. My problem is everything works all fine and dandy until I try to use any third party libs in the component that my mdx file is referencing. (See https://codesandbox.io/s/sharp-austin-m0z74?from-embed=&file=/flex-docs/docs/doc2.mdx for more details which mirrors my real setup) So it works in my real setup if the Test component is just plain with no imports, but as soon as I import any styled-components into the Test component, or any @material-ui/core components into my Test component, then all the sudden it starts throwing the following error. I don't get it. I made sure the react versions were the same and everything. I'm using docusaurus v2. (https://codesandbox.io/s/sharp-austin-m0z74?from-embed=&file=/flex-plugins/src/components/demo.jsx)
Any help would be greatly appreciated! I love your product.
P.s. I found this thread by searching "docusaurus invoke component in another directory" btw.. Thnx in advance!
@chase2981 what you are looking for is likely a Yarn Workspace / Lerna monorepo. That's not really related to this issue not Docusaurus but is related to modularisation of your own js code.
Activity
endiliey commentedon Jun 30, 2018
Sorry for the late response. Unfortunately, the answer is no atm. We are addressing this in v2 😊
endiliey commentedon Oct 23, 2018
Yes. But only in v2.
Coming soon
franc0is commentedon Nov 19, 2019
For what it's worth, I just tried this in V2 and it works :-).
caiorasc commentedon Nov 19, 2019
Thanks, I'll try the v2
chase2981 commentedon Nov 29, 2020
Could someone please tell me how to accomplish something like the following please? Essentially I can't have all my docs and my components be in the same directory cuz i have multiple apps in my project. Therefore I have a
flex-docsfolder, (which is essentially the docusaurus "website" folder) then I have aflex-pluginsfolder, aflex-webchat-uifolder, and aflex-libfolder. My problem is everything works all fine and dandy until I try to use any third party libs in the component that my mdx file is referencing. (See https://codesandbox.io/s/sharp-austin-m0z74?from-embed=&file=/flex-docs/docs/doc2.mdx for more details which mirrors my real setup) So it works in my real setup if theTestcomponent is just plain with no imports, but as soon as I import anystyled-componentsinto theTestcomponent, or any@material-ui/corecomponents into myTestcomponent, then all the sudden it starts throwing the following error. I don't get it. I made sure the react versions were the same and everything. I'm using docusaurus v2. (https://codesandbox.io/s/sharp-austin-m0z74?from-embed=&file=/flex-plugins/src/components/demo.jsx)Any help would be greatly appreciated! I love your product.
P.s. I found this thread by searching "docusaurus invoke component in another directory" btw.. Thnx in advance!
slorber commentedon Nov 30, 2020
@chase2981 what you are looking for is likely a Yarn Workspace / Lerna monorepo. That's not really related to this issue not Docusaurus but is related to modularisation of your own js code.