-
Notifications
You must be signed in to change notification settings - Fork 72
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 Request: React does not recognize the prop #125
Comments
Hi - I definitely agree with you, noise in the console is annoying and should not be tolerated, even if everything works :) I'm new to this project so I can't give you an immediate answer, but I'm going to try to take a look and see what's causing this and if we can get rid of the warnings. Of course if you open a PR with a solution I'd be thrilled to review. :-) |
@RyanHow For clarification, is the React component you're using something from This was once a common practice in React-land, but now React recommends against it with this warning. See here: https://reactjs.org/warnings/unknown-prop.html Am I on track here? Or completely missing the point? Like I said, I'm new to this project so please let me know if I'm missing something. |
I'm just using the convention in the fabric component as a reference. It's a 3rd party React component I'm wrapping. My component differs from the fabric one though because it's wrapped in a div. I think that may be causing the issue. Like this:
If I remove the wrapping div, then it seems to work without the error. Maybe I should be wrapping each React component separately then assembling them in Angular space? Apart from this issue, it seems to all work fine though. And the components are very tightly coupled and would never be used separately, so it's just a lot of extra wrapping, then making an angular component and passing through all the props. So I'm hoping it doesn't need that unnecessary extra layer. What I was trying to do was like the fabric component here There is this
So it isn't a react prop. It's adding a bit of Angularification in the wrapper to make it nicer to use in Angular space. The warning appears to be because it is still getting passed along to the react component (It's passing it along to the div element), which doesn't recognise it. Is there a way to stop it being passed along? React just seems to strip it out, which is fine, it's just that it generates console noise. I'm new to React. I'd assume there is a way to supress the error, but it would seem nicer to be able to specify that the property isn't passed to the react component? I hope that makes sense! Thanks :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have precisely the same issue. Getting the unknown prop warning for 'checkedChange'. Were there any further ideas how to resolve this?
|
I didn't come across any solutions |
In my opinion, this is the industry being too opinionated. We should be able to use custom attributes with any casing. This is simply silly |
Hi,
I'm trying to achieve 2 way data binding to a property. Similar to in this example where the React prop doesn't meet the naming conventions for the Angular banana box syntax.
https://github.com/microsoft/angular-react/blob/master/libs/fabric/src/lib/components/checkbox/checkbox.component.ts
However I get a warning from React
My prop is called
query
, the React prop is calledonEditQuery
(which I bind as [EditQuery]), so I've made aqueryChange
EventEmitter, then emit an event in theEditQuery
handler function.Is there any workaround for this? It still all works, I just don't like the errors in the console.
Thanks!
The text was updated successfully, but these errors were encountered: