Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question, would render to string be possible? #52

Open
Nubuck opened this issue Jun 26, 2016 · 4 comments
Open

Question, would render to string be possible? #52

Nubuck opened this issue Jun 26, 2016 · 4 comments
Labels

Comments

@Nubuck
Copy link

Nubuck commented Jun 26, 2016

Hi, big fan of React Blessed here.

I've been wondering if it would be possible to render a sub-set of components to string or stdout without attaching the entire screen?

The reason I ask, is that I'd love to be able to use this with commander and inquirer based apps for rendering responses... for example:

console.log(ReactBlessed.renderToString(<FancyLogComponent {...someProps} />))
@Yomguithereal
Copy link
Owner

Hello @Nubuck. I don't remember whether react-dom/server enforces HTML or just render plain XML but you may want to try it, it could work :). If it doesn't then, I guess someone would need to create a XML renderer for React to cope with this kind of usecases.

@Nubuck
Copy link
Author

Nubuck commented Jun 29, 2016

@Yomguithereal shows my ignorance, I assumed it only rendered HTML when my attempts crashed. I'll dig deeper to find if there is a way around the validations. Thanks for replying!

@Yomguithereal
Copy link
Owner

If there is no way around the validations then we need to build a custom renderer and I'm thinking of creating one for outputting custom XML outputs.

@Nubuck
Copy link
Author

Nubuck commented Jun 29, 2016

That was my thinking as well. I want to build my dev environment the same way I build products... so I'm working on a way to make that happen.
I'd really like to see the completion of JSXN (jsx notation for json trees) it would make schema management really pleasant...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants