Skip to content
This repository was archived by the owner on Jul 28, 2019. It is now read-only.
This repository was archived by the owner on Jul 28, 2019. It is now read-only.

make reactDirective composable (feature) #214

@maddrag0n

Description

@maddrag0n

When using ReactJS, chances are high you might want to use other third-party libraries that need to be instantiated and/or injected, such as TapEventPlugin, react-bootstrap or Material-UI.

A very ReactJS way to do that for ngReact is to write a (or multiple) higher order components and compose them.

import React from 'react';
import compose from 'recompose/compose';
import withTapEventPlugin from '…';
import withMaterialUiTheme from '…';

const MyComponent = ({ title }) => <span>{title}</span>;

const enhance = compose(
  withTapEventPlugin,
  withMaterialUiTheme({ someConfig: true }),
);

export default enhance(MyComponent);

It would be super awesome to be able to do the same with reactDirective, e. g.

// …

const enhance = compose(
  withTapEventPlugin,
  withMaterialUiTheme({ someConfig: true }),
  reactDirective([ 'title' ]),
);

export default enhance(MyComponent);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions