To call the function you have to add ()
{this.renderIcon()}
More Related Contents:
- How to add function in JSX?
- Loop inside React JSX
- Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function but got: object
- Why shouldn’t JSX props use arrow functions or bind?
- Render HTML string as real HTML in a React component
- Parse Error: Adjacent JSX elements must be wrapped in an enclosing tag
- React – User-Defined JSX Components Not rendering
- Applying className/onClick/onChange not working on Custom React Component
- How to use componentWillMount() in React Hooks?
- ReactJS – .JS vs .JSX
- Can I add a key prop to a React fragment?
- How to render HTML string as real HTML?
- React.js: Identifying different inputs with one onChange handler
- ESLint with React gives `no-unused-vars` errors
- Where should functions in function components go?
- Passing props into external stylesheet in React Native?
- What do curly braces mean in JSX (React)?
- How to have nested loops with map in JSX?
- Using styled-components with props and TypeScript
- ES6 destructuring function parameter – naming root object
- JavaScript function order: why does it matter?
- Detecting when user scrolls to bottom of div with React js
- Event target is null inside functional setState
- Sort an array of objects in React and render them
- How can I update an object inside of an array in firestore? [duplicate]
- Increase JavaScript Heap size in create-react-app project
- Global state in React Native
- At what nesting level should components read entities from Stores in Flux?
- Destructuring of es6 but passing dynamic variable
- Javascript function need allow numbers, dot and comma