问题
I've got a reactJS application with react-toolbox
in console I got this error:
Warning: Unknown prop `raised` on <a> tag. Remove this prop from the element.
Any Idea how I can solve this warning? I don't want to remove the tag, is there workaround to get this worked with not removing this?
thanks
Update
<Button icon='save' type="submit" label={<T value='processes.new.save'/>} raised primary/>
I use this stuff: http://react-toolbox.com/#/components/button
回答1:
This is happening because the 'raised' prop is being added as a prop to the <a>
that the <Link>
makes. You can include additional information through the state property of the location.
check Link docs
回答2:
React gives you a warning whenever you add attributes to a DOM
-tag that is not in the HTML spec. raised
is not a valid <a />
attribute, so therefore React lets you know that you might have made a mistake. The tag - although it will be applied to the DOM (IIRC) - is not acted upon by any browser. If you need to add custom attributes for other reasons, use data-
-prepended attributes, like data-raised
in your case.
This looks like it needs to be a class or something instead of an attribute on the a
tag - but without seeing your code, it's a bit hard to give a more precise answer.
来源:https://stackoverflow.com/questions/44926777/react-js-warnings-in-console-unknown-prop