Warning: Unknown prop `render` on <li> tag. Remove this prop from the element
See original GitHub issueHi, I got strange warning, may be i use wrong implementation or something else. Please check. my code:
import PropTypes from 'prop-types';
import moment from 'moment';
import { withStyles } from 'material-ui/styles';
import stylesFunc from './ChatTextMsg.styles';
import { ContextMenu, Item, Separator, Submenu, ContextMenuProvider } from 'react-contexify';
const styles = theme => (stylesFunc(theme, scrollWidth()));
class ChatTextMsg extends Component {
constructor(props) {
super(props);
this.state = {};
}
renderMessage({ files, created, from }) {
const { classes } = this.props;
const time = moment(created).format("HH:mm:ss A");
return (
<ContextMenuProvider id="text_bubble">
<li className={ classes.messageItem }>
<p>{
//render text data
}</p>
<p className={classes.messageTime}>{ time }</p>
</li>
</ContextMenuProvider>
)
}
render() {
const { classes, data, activeDialogId } = this.props;
return (
<ul className={data.from === activeDialogId ? `${classes.messageList} his-list` : `${classes.messageList}`}>
{ this.renderMessage(data) }
</ul>
)
}
}
ChatTextMsg.propTypes = {
classes: PropTypes.object.isRequired
};
export default withStyles(styles)(ChatTextMsg);
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Unknown prop on <> tag. Remove this prop from the element ...
You are using a React component without an upper case. React interprets it as a DOM tag because ... Share.
Read more >Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >Get rid of `Unknown props` react's warnings : HUB-4674
When opening dashboards list: Unknown props selectedLabel , description , originalModel , onDismissClick , sharedHeaderText , dismissLinkText on <span> tag.
Read more >[Solved]-Warning: Unknown prop on <> tag. Remove this prop ...
Coding example for the question Warning: Unknown prop on <> tag. Remove this prop from the element-Reactjs.
Read more >Useful Patterns by Use Case - React TypeScript Cheatsheets
Wrapping/Mirroring a HTML Element. Usecase: you want to make a <Button> that takes all the normal props of <button> and does extra stuff ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Realised I referenced the elements a bit silly. To clarify the error references a div instead of a li element!
@fkhadra 1st point works well!