1

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

Felix
  • 5,452
  • 12
  • 68
  • 163

2 Answers2

2

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

taha
  • 997
  • 9
  • 17
  • thanks for the docs Link. But can you make an example for me? – Felix Jul 06 '17 at 21:28
  • thats not a solution for this problem – Felix Jul 06 '17 at 21:30
  • Are you getting any other warnings, like "Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead." @Felix – taha Jul 06 '17 at 21:40
  • I've read this as well but the problems still pending ... and I think my one is another one – Felix Jul 09 '17 at 11:32
1

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.

Kris Selbekk
  • 7,438
  • 7
  • 46
  • 73
  • thats not an solution. thats an attribute from react-toolbox so your solution does not work. – Felix Jul 06 '17 at 21:26
  • Looking at the code in react-toolbox, I think there is a different part of your code that triggers this warning. `` will only be an `` tag if a `href` attribute is selected - which your example does not have. Please provide some more information / code samples for a more informed answer =) – Kris Selbekk Jul 11 '17 at 09:37