Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

<Rating name='facilityRate' 
emptySymbol={<img src='../star-empty.png' className='icon' alt='empty star' />}
fullSymbol={<img src='../star-full.png' className='icon' alt='filled star' />} 
onChange={this.handleRatingChange} 
value={this.state.form.facilityRate} />


handleRatingChange(value) {
    console.log(value);
    //here set your state for rating
}
Comment

× error: element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. you likely forgot to export your component from the file it

In my case (using Webpack) it was the difference between:

import {MyComponent} from '../components/xyz.js';
vs

import MyComponent from '../components/xyz.js';
The second one works while the first is causing the error. Or the opposite.
Comment

PREVIOUS NEXT
Code Example
Javascript :: error:0308010C:digital nextjs 
Javascript :: actionscript random randomfunction 
Javascript :: find the missing number in js 
Javascript :: disable SerializableStateInvariantMiddleware and ImmutableStateInvariantMiddleware middlewares for large redux stores 
Javascript :: card types regex 
Javascript :: suitescript get lineitemcount 
Javascript :: javascript addall 
Javascript :: Remove key from obj and save in diff obj 
Javascript :: Could not resolve "i18n-iso-countries" 
Javascript :: use anchor element to open file 
Javascript :: set rotation and origin phaser 
Javascript :: phaser grid align 
Javascript :: phaser add animation event 
Javascript :: phaser play animation with config.js 
Javascript :: Node.js technical interview samples 
Javascript :: template literal inside a key in react 
Javascript :: polygon intersection js 
Javascript :: javascript to jquery code converter online 
Javascript :: moment js with nodejs 
Javascript :: how to put multiple conditions in if statement node .js 
Javascript :: delete parent js 
Javascript :: javascript event.target 
Javascript :: extract data from pdf nodejs 
Javascript :: grid in js 
Javascript :: Set CSS styles with javascript 
Javascript :: angular set timezone 
Javascript :: javascript sort object by value descending 
Javascript :: open modal using jquery 
Javascript :: chrome.contextmenus 
Javascript :: add 7 days in date using jquery 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =