react-page-maker
react-page-maker copied to clipboard
[Question] How to render the page based on the generated JSON ?
Thanks for excellent implementation.
One question: What's the best way to render the page after generating the JSON ?
Hey @revskill10
Right now we do not have feature of preview, but yes, soon I'm going to add and publish the same. You can expect some Preview component which will accept generated JSON and Preview Tags which will give us expected output.
Hope I answered your question.
@keermanish In my case, when a user is an admin, i want to show a button to switch to the drag-drop view, and when the user is a normal user, i want to show the Preview component instead.
I'm using SSR also. I tried last night to traverse the tree of currentState to produce the elements, but the way of using componentWillMount is a bit hard to understand to me.
Hope we could make the Preview soon.
And lastly, that generated JSON will be used to store in a database.
Thanks !
@revskill10 Added support for Preview component, check updated doc.
Regarding SSR, right now you might face difficulties while storing state as is, since current state has some necessary functions included. Also to pre-populate the existing state, we need to pass all sub-fields as initialElements to canvas, need to find some easy way for the same.