trivago/melody

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

Ouverte

#76 ouverte le 20 nov. 2018

 (1 commentaire) (0 réaction) (0 personne assignée)JavaScript (37 forks)auto 404
enhancementgood first issuehelp wanted

Métriques du dépôt

Stars
 (216 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur