arc-m
(arc-m stands for Angular React Component Module)
Angular module for wrapping react components in order to use them directly in angular components.
Installation
npm i arc-m
Limitation
⚠️ Doesn't work with AOT-compliler for now.
Usage
- Write a react component. Use
prop-types
to describe the component props.
;; ;HelloWorld.propTypes =;
-
Register the react component and just use it
a. via reference
;;;;ARC
is just a placeholder for the actual component selector ofHelloWorld
and can be changed. The selector of the angular component which wraps the react component is created dynamically.b. or with a custom selector
;;;registerReactComponents; -
Import arc module
;;;
registerReactComponents
API
registerReactComponents Array< object | // React component reference >,