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

Thinking about React 15 support #58

Open
tbranyen opened this issue Feb 1, 2017 · 7 comments
Open

Thinking about React 15 support #58

tbranyen opened this issue Feb 1, 2017 · 7 comments

Comments

@tbranyen
Copy link

tbranyen commented Feb 1, 2017

I'd like to help contribute migrating this project to React 15, and I think we could greatly reduce the amount of code necessary. For instance, right now the code is doing a ton of dependency injection since we don't have screen in scope. What if this library looked something like this instead?

import React, { Component } from 'react';
import blessed from 'blessed';
import { Element, Box, render } from 'react-blessed';

export default class TerminalApp extends Component {
  render() {
    return (
      <Element>
        <Box width="100%" height="50%" top="0%">Top</Box>
        <Box width="100%" height="50%" top="50%">Bottom</Box>
      </Element>
    );
  }
}

const screen = blessed.screen({
  autoPadding: true,
  smartCSR: true,
});

render(<TerminalApp />, screen);
@DxCx
Copy link

DxCx commented Jul 17, 2017

hey @tbranyen any update on this?

@abritinthebay
Copy link

This is a much nicer interface

@Delapouite
Copy link

The focus can also be on React 16 now.

@geyang
Copy link

geyang commented Jan 19, 2018

this would be nice. A provider component is the way to go!

@Yomguithereal
Copy link
Owner

Yomguithereal commented Jan 24, 2018

The way I see it is the difference is that you explicitly require elements' dependencies. While I see the point, I find it a bit weird. You don't do:

import {div, br, table} from 'react-dom';

for instance, to load the driver's primitives.

The distinction enables you to separate primitives from components, no?

@tbranyen
Copy link
Author

If it's easy to make that work, then I agree with that feedback. I'm actually really needing this now for a project at work so I can put some time into make it work the way I proposed. If you have some tips on how to preload React with those components so it works like react-dom does, then I'd be happy to do it that way.

@Yomguithereal
Copy link
Owner

If you have some tips on how to preload React with those components so it works like react-dom does.

I don't understand what you mean. This is already the case. Tou don't have to "preload" the components, they are not components but primitives.

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

No branches or pull requests

6 participants