How to use inferno-component - 2 common examples

To help you get started, we’ve selected a few inferno-component examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magnus-bergman / inferno-firebase / src / connect.js View on Github external
const actionProps = pickBy(
          firebaseProps,
          prop => typeof prop === 'function'
        );
        const subscriptionProps = this.state.subscriptionsState;
        const props = mergeProps(this.props, {
          ...actionProps,
          ...subscriptionProps,
        });

        return createElement(WrappedComponent, props);
      }
    }

    FirebaseConnect.WrappedComponent = WrappedComponent;
    FirebaseConnect.defaultProps = Component.defaultProps;
    FirebaseConnect.displayName = `FirebaseConnect(${getDisplayName(WrappedComponent)})`;
    FirebaseConnect.contextTypes = FirebaseConnect.propTypes = {
      firebaseApp: shape({
        database: func.isRequired, // eslint-disable-line react/no-unused-prop-types
      }),
    };

    return FirebaseConnect;
  };
};
github zanettin / incompose / src / isClassComponent.js View on Github external
const isClassComponent = ComponentArg => Boolean(
  ComponentArg &&
  ComponentArg.prototype &&
  typeof ComponentArg.prototype.render === 'function' &&
  Component.isPrototypeOf(ComponentArg)
);

inferno-component

Inferno ES6 Component

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis