Title: Help requested on wrapping react component into angular · Issue #157 · microsoft/angular-react · GitHub
Open Graph Title: Help requested on wrapping react component into angular · Issue #157 · microsoft/angular-react
X Title: Help requested on wrapping react component into angular · Issue #157 · microsoft/angular-react
Description: 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-c...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/microsoft/angular-react/issues/157
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Help requested on wrapping react component into angular","articleBody":"Hi all,\r\n\r\n 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.\r\n\r\n- I've successfully achieved the use of already provided fab elements (fab-calendar, fab-dialog or fab-primary-button) and setting their properties successfully\r\n\r\n- I've successfully created a React JS library (packed and deployed) and used in React Applications \r\n\r\n> import React, { Component } from 'react'\r\n> import PropTypes from 'prop-types'\r\n> \r\n> import styles from './styles.css'\r\n> \r\n> export default class ExampleComponent extends Component {\r\n> constructor(props) {\r\n> super(props);\r\n> }\r\n> \r\n> static propTypes = {\r\n> name: PropTypes.string\r\n> }\r\n> \r\n> render() {\r\n> \r\n> return (\r\n> \u003cdiv className={styles.test}>\r\n> Hello {this.props.name} {this.props.lastname}\r\n> \u003c/div>\r\n> )\r\n> }\r\n> }\r\n> \r\n\r\n- But I'm stuck on creating the wrapper library as described in [Authoring wiki page](https://github.com/microsoft/angular-react/wiki/Wrapper-libraries%3A-Authoring)\r\n\r\nModule 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](https://github.com/microsoft/fluentui/blob/master/packages/office-ui-fabric-react/src/components/Dialog/Dialog.base.tsx) and [Component Wrapper](https://github.com/microsoft/angular-react/blob/master/libs/fabric/src/lib/components/dialog/dialog.component.ts) but these are bit complex to follow.\r\n\r\nOne of the requirements of ReactWrapperComponent is to place a \u003cTProps extends {}> which for Fabric element is made through Typescript Interface definitions e.g. export class FabDialogComponent extends ReactWrapperComponent\u003cIDialogProps>, but as I'm using React in JS and not Typescript, It's not clear to me, what to put in ReactWrapperComponent\u003c> and how to access my react Props (i.e. name & lastname).\r\n\r\n- Is it necessary to work with React Typescript or is it possible to wrap libraries in React JS?\r\n- What is the goal of renderCount && onRenderCount in the [Authoring wiki](https://github.com/microsoft/angular-react/wiki/Wrapper-libraries%3A-Authoring)?\r\n- Following [Fabric Component Wrapper](https://github.com/microsoft/angular-react/blob/master/libs/fabric/src/lib/components/dialog/dialog.component.ts) example I miss (onIncrement)=\"onIncrementHandler($event)\" or similar in the template, am I missing something?\r\n- Could you provide or is it accessible the 'my-react-ui-library' used in [Authoring wiki](https://github.com/microsoft/angular-react/wiki/Wrapper-libraries%3A-Authoring)?\r\n- Could somebody provide a corresponding wrapper code for the simple example (ExampleComponent) provided above?\r\n\r\nThanks in advance and sorry for the dumminess,\r\n\r\nGorka","author":{"url":"https://github.com/epetxepe","@type":"Person","name":"epetxepe"},"datePublished":"2020-03-24T16:39:13Z","url":"https://github.com/microsoft/angular-react/issues/157"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9f9800e0-5f69-534e-ca6e-b3298695de64 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9670:36A3E:A6F789:E0952E:6B00EFFC |
| html-safe-nonce | e4e7c7631c2db7b40d467c80d8d2128fba5dc50b2f653445e005c641af882d75 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjcwOjM2QTNFOkE2Rjc4OTpFMDk1MkU6NkIwMEVGRkMiLCJ2aXNpdG9yX2lkIjoiNzQ0NTQyMTQzMTU0MDI0NDQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 33649579d50ca142bdef20fe7639aa059905585bb15fce10102191dcaa1e270e |
| hovercard-subject-tag | issue:587104245 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/angular-react/157/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3adea2282780bafbb141ab759a8cf2956ed1fb8a48c9e2662a4efe859cf82c62/microsoft/angular-react/issues/157 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3adea2282780bafbb141ab759a8cf2956ed1fb8a48c9e2662a4efe859cf82c62/microsoft/angular-react/issues/157 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | epetxepe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/angular-react git https://github.com/microsoft/angular-react.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 144321557 |
| octolytics-dimension-repository_nwo | microsoft/angular-react |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 144321557 |
| octolytics-dimension-repository_network_root_nwo | microsoft/angular-react |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width