-
-
Notifications
You must be signed in to change notification settings - Fork 121
Can't use Dante2 with react or nextjs at all? #188
Comments
please check your dependences, if they are missing you have to install them |
I tried next.js examples. That's for draft.js. That works but I like your editor Dante :) So First thing i do is import :
I get greetings with this error: So as the error says module not found, I installed them:
Then I get this error: So I tried installing that too:
Then I got this error: So I installed that too: npm i emotion-theming Ok so no more errors. I tried Dante
Then I get the following error: Now that's a dead end. So any suggestions? This is my package.json
|
I think we need to handle all the window definitions with something like
this:
if (typeof window !== 'undefined') {
Atte.
Miguel Michelson Martinez
www.vadb.org <http://vadb.org>
…On Sun, Nov 24, 2019 at 7:56 PM Ryan (Narayan) Dhungel < ***@***.***> wrote:
I tried next.js examples. That's for draft.js. That works but I like your
editor Dante :)
So First thing i do is import :
import Dante from 'Dante2'
I get greetings with this error:
[image: Screen Shot 2019-11-25 at 7 47 40 AM]
<https://user-images.githubusercontent.com/15702617/69503002-6a711500-0f69-11ea-908d-62888a6b78b9.png>
So as the error says module not found, I installed them:
npm i @emotion/styled
Then I get this error:
[image: Screen Shot 2019-11-25 at 9 37 07 AM]
<https://user-images.githubusercontent.com/15702617/69503006-78269a80-0f69-11ea-852a-1bf6a566a21d.png>
So I tried installing that too:
npm i @emotion/core
Then I got this error:
[image: Screen Shot 2019-11-25 at 9 46 19 AM]
<https://user-images.githubusercontent.com/15702617/69503028-b6bc5500-0f69-11ea-84a8-31764f9b3d7d.png>
So I installed that too:
npm i emotion-theming
Ok so no more errors. I tried Dante
return (
<div>
<Dante />
</div>
)
Then I get the following error:
[image: Screen Shot 2019-11-25 at 9 50 26 AM]
<https://user-images.githubusercontent.com/15702617/69503042-d5bae700-0f69-11ea-96bd-eeef30ac8a35.png>
Now that's a dead end. So any suggestions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#188?email_source=notifications&email_token=AAAC5SBY4PVWSVBAHSM4BRTQVMBCTA5CNFSM4JQYSIX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAXDJI#issuecomment-557937061>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAC5SCS7JAH72SXB7SWRQDQVMBCTANCNFSM4JQYSIXQ>
.
|
Hi, this is a really great project. The demo works amazing. Here are the errors I get:
Thank you for your time. |
@miguelangeltorresfp
|
Hi @kaloraat , you can implement a draft renderer from redraft library. here is an example for render draft content content , without the need initialize Dante editor. It implements the markup of dante components though https://gist.github.com/michelson/904e1a6a2e49762437606cb22a77fcfe hope it helps |
example: import { ThemeProvider } from 'emotion-theming'
import DraftRenderer from './draftRenderer' // <-- the one from the gist
import theme from 'Dante2/package/es/editor/components/Dante/themes/default'
import EditorStyles from 'Dante2/package/es/styled/base'
<ThemeProvider
theme={ theme }>
<EditorStyles>
<DraftRenderer
raw={JSON.parse(serialized_content)}
/>
</EditorStyles>
</ThemeProvider> |
@michelson thanks but i can't use theme. |
hi @kaloraat , maybe you could use the files built at hope it helps |
|
I ran in nextjs using this approach:
When you need to render in nextjs you can try with:
As this library runs only in the client side. |
I'm trying to use Dante2@next with a React SSR project by including this simple code part (use of loadable lib): import loadable from '@loadable/component'
const Dante = loadable(() => import('Dante2'))
const ContentMode = { target, mode, data }) => {
switch (mode) {
case 'edit':
if (target == 'title') return <h1><Dante content={data.title}/></h1>
}
} and i get an error: why is this happening ? |
This is a great project however you can't even install in your react project (create-react-app) or nextjs. Not only that, even the Github repo of this project cant run locally (used git clone). Has the author even tried to use it with create-react-app, nextjs or even run the project locally using git clone?
Here I have started a bare bone react/nextjs app and import Dante2. I just cant get it running, countless errors window is not defined, @emotion/cache module not found, @emotion/core module not found ...
Can you please have a look at my repo and suggest me how to get going with Dante2? You can clone the repo and run using
Cheers!
The text was updated successfully, but these errors were encountered: