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

melody-hooks requires using melody-component for rendering root component #76

Open
pago opened this issue Nov 20, 2018 · 1 comment
Open

Comments

@pago
Copy link
Contributor

pago commented Nov 20, 2018

Explain the problem

When trying to mount a root component written using the melody-hooks API, we still need to rely on melody-component in order to render the root component.

Expected Behaviour

There is a way to render a top-level component from melody-hooks without having to rely on melody-component.

import { render } from 'melody-hooks';
import home from './home';

const documentRoot = document.getElementById('root');
render(documentRoot, home, {
    message: 'Welcome to Melody!'
});

Actual Behaviour

The only way to render a top-level melody-hooks component is by using render from melody-component.

import { render } from 'melody-component';
import home from './home';

const documentRoot = document.getElementById('root');
render(documentRoot, home, {
    message: 'Welcome to Melody!'
});

Provide your Environment details

  • melody version: 1.2.0-0
@malte-wessel
Copy link
Contributor

I see three options here:

  1. Create a melody-render package
  2. Move render logic to melody-idom
  3. Duplicate render logic in melody-hooks.

I would go for option 2, since a lot of component logic is already in melody-idom. What do you think?

@pago pago added this to the 1.2.0 milestone Jan 13, 2019
@pago pago mentioned this issue Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants