question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Unknown prop `render` on <li> tag. Remove this prop from the element

See original GitHub issue

Hi, 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:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marjo688commented, May 14, 2018

Realised I referenced the elements a bit silly. To clarify the error references a div instead of a li element!

1reaction
OlegPinchukcommented, Apr 23, 2018

@fkhadra 1st point works well!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found