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

Help requested on wrapping react component into angular #157

Open
epetxepe opened this issue Mar 24, 2020 · 0 comments
Open

Help requested on wrapping react component into angular #157

epetxepe opened this issue Mar 24, 2020 · 0 comments

Comments

@epetxepe
Copy link

Hi all,

I'm trying to learn how to use the angular-react through the examples in the wiki. Not sure if this is the correct place to ask, please tell me otherwise.

  • I've successfully achieved the use of already provided fab elements (fab-calendar, fab-dialog or fab-primary-button) and setting their properties successfully

  • I've successfully created a React JS library (packed and deployed) and used in React Applications

import React, { Component } from 'react'
import PropTypes from 'prop-types'

import styles from './styles.css'

export default class ExampleComponent extends Component {
constructor(props) {
super(props);
}

static propTypes = {
name: PropTypes.string
}

render() {

return (
  <div className={styles.test}>
    Hello {this.props.name} {this.props.lastname}
  </div>
)

}
}

Module specification is quite straightforward, but I'm stuck with component definition. I've tried looking at how it was made for Fabric e.g. Dialog => React and Component Wrapper but these are bit complex to follow.

One of the requirements of ReactWrapperComponent is to place a <TProps extends {}> which for Fabric element is made through Typescript Interface definitions e.g. export class FabDialogComponent extends ReactWrapperComponent, but as I'm using React in JS and not Typescript, It's not clear to me, what to put in ReactWrapperComponent<> and how to access my react Props (i.e. name & lastname).

  • Is it necessary to work with React Typescript or is it possible to wrap libraries in React JS?
  • What is the goal of renderCount && onRenderCount in the Authoring wiki?
  • Following Fabric Component Wrapper example I miss (onIncrement)="onIncrementHandler($event)" or similar in the template, am I missing something?
  • Could you provide or is it accessible the 'my-react-ui-library' used in Authoring wiki?
  • Could somebody provide a corresponding wrapper code for the simple example (ExampleComponent) provided above?

Thanks in advance and sorry for the dumminess,

Gorka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant