Tiptap-editor display the content

I want to display the data created by the Tiptap editor on the Next.js application. I send my data via an API using Laravel.
4 Replies
awcodes
awcodes5w ago
There’s 2 approaches here. The easiest would be to use the TiptapConverter class to return the content as an html string that could be output in the react component if you are storing as json. Otherwise you would need some way to traverse the ast tree to output appropriate react components for each type of content. This is all trivial in blade. But is a different story when trying to do this in nextjs and react. I would be open for react/vue/svelte converters though if anyone is interested in PRing them.
Aminne
Aminne5w ago
I tried this but the problem i get the content without style what're you thinking about parse the data by ckeditor in nextjs app , it will be work?
awcodes
awcodes5w ago
The styling is all up to you. The plugin can’t and shouldn’t have any opinions about how the html is displayed outside the editor. I typically start by using tailwind’s typography plugin which covers like 80-90% of what I need.
Aminne
Aminne5w ago
okay i understand , it must make a styling for this data i use the tailwind also, after i will try, thank you so much for your response.