Title: Help Request: React component is checking for a prop when it is created, but the prop doesn't appear to be supplied until later · Issue #124 · microsoft/angular-react · GitHub
Open Graph Title: Help Request: React component is checking for a prop when it is created, but the prop doesn't appear to be supplied until later · Issue #124 · microsoft/angular-react
X Title: Help Request: React component is checking for a prop when it is created, but the prop doesn't appear to be supplied until later · Issue #124 · microsoft/angular-react
Description: Hi! I'm trying to create a wrapper around a React component to use within Angular. I haven't done much with React before, so that side of things is quite new to me. I'm getting an error that a prop is required, but I am supplying that pr...
Open Graph Description: Hi! I'm trying to create a wrapper around a React component to use within Angular. I haven't done much with React before, so that side of things is quite new to me. I'm getting an error that a prop...
X Description: Hi! I'm trying to create a wrapper around a React component to use within Angular. I haven't done much with React before, so that side of things is quite new to me. I'm getting an error...
Opengraph URL: https://github.com/microsoft/angular-react/issues/124
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Help Request: React component is checking for a prop when it is created, but the prop doesn't appear to be supplied until later","articleBody":"Hi!\r\n\r\nI'm trying to create a wrapper around a React component to use within Angular. I haven't done much with React before, so that side of things is quite new to me.\r\n\r\nI'm getting an error that a prop is required, but I am supplying that prop.\r\n\r\nI had a look and the component is expecting a prop to be set when it is created. However it appears that in Angular-React, the property is supplied later.\r\n\r\nThe component still works, but it logs a whole lot of errors before it starts working.\r\n\r\nThe error is like this:\r\n\r\n```\r\nERROR TypeError: MyReactComponent requires a fetch function.\r\n at new MyReactComponent (MyReactComponent.js:114)\r\n```\r\n\r\nThe code that is throwing the error is this:\r\n\r\n```\r\nif (typeof props.fetch !== 'function') {\r\n throw new TypeError('MyReactComponent requires a fetch function.');\r\n}\r\n```\r\n\r\nIn my template I have (This is slightly simplified, there are multiple related components in there)\r\n\r\n```\r\n\u003cdiv #reactNode className=\"myreactcomponent-container\">\r\n \u003cMyReactComponent [fetch]=\"fetch\">\u003c/MyReactComponent>\r\n\u003c/div>\r\n```\r\n\r\nAnd fetch is a function in the class (and it is being called)\r\n\r\n\r\nSo I am just wondering if I am doing anything incorrectly, or is there a way I can supply the fetch prop earlier on to avoid the error?\r\n\r\nThanks!\r\n\r\nRyan","author":{"url":"https://github.com/RyanHow","@type":"Person","name":"RyanHow"},"datePublished":"2019-06-11T02:56:27Z","url":"https://github.com/microsoft/angular-react/issues/124"}
| 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:aa95c944-02fa-4c11-a0d4-f6f316bbaf1e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB1E:240CD1:98B393:C42B01:6B00EFC1 |
| html-safe-nonce | e8d50ff0960e81a2af8d312a2be9be6e26fe5095fef7f015ac4cfae5906ba8e1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjFFOjI0MENEMTo5OEIzOTM6QzQyQjAxOjZCMDBFRkMxIiwidmlzaXRvcl9pZCI6IjU4MTk1MjU4MzI4MjkzNjYyMDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e384ce8f6f010d6919335bf4580b55e1e727d8d4c61a49494abc97a270edc80a |
| hovercard-subject-tag | issue:454457230 |
| 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/124/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ab9520639dcf149780dbeba6e82a10749300ddbc2694ada85d466d4210626f6/microsoft/angular-react/issues/124 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ab9520639dcf149780dbeba6e82a10749300ddbc2694ada85d466d4210626f6/microsoft/angular-react/issues/124 |
| og:image:alt | Hi! I'm trying to create a wrapper around a React component to use within Angular. I haven't done much with React before, so that side of things is quite new to me. I'm getting an error that a prop... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanHow |
| 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