Trying to get a basic example working
See original GitHub issueHi, i’m still quite new at using 3rd party react components and cannot get a simple example working.
Here’s my code
<!DOCTYPE html>
<html>
<head>
<title>Test a simple select</title>
<script src="/resources/js/react.js"></script>
<script src="/resources/js/JSXTransformer.js"></script>
<script type="text/jsx" src="/resources/js/classnames.js"></script>
<script type="text/jsx" src="/resources/js/react-select.min.js"></script>
<script type="text/jsx" src="/resources/js/react-input-autosize.min.js"></script>
<link rel="stylesheet" type="text/css" href="/resources/css/react-select.css">
</head>
<body>
<div id="example"></div>
<script type="text/jsx">
var options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' }
];
function logChange(val) {
console.log("Selected: " + val);
}
console.log("options: " + toString(options));
React.render(
<Select
name="form-field-name"
value="one"
options={options}
onChange={logChange}
/>,
document.getElementById('example')
);
</script>
</body>
</html>
From the javascript console, i get these
Warning: React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components).
Warning: Only functions or strings can be mounted as React components.
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
I wonder where i mess up.
Please share your insights, thank you.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8
Top Results From Across the Web
Visual Basic (VB.NET) – Full Course for Beginners - YouTube
Lean the fundamentals of programming with Visual Basic (sometimes called Visual Basic .NET or VB.NET).In this tutorial, you will learn about ...
Read more >Tutorial: Create a simple Visual Basic (VB) console app
In this tutorial, you learn how to create a Visual Basic console application in Visual Studio.
Read more >How to Answer “Why Do You Want to Work Here?”
Of all the interview questions job applicants prepare for, the most obvious ones sometimes get the least attention. Yes, you came ready to ......
Read more >How to Start Coding: The Ultimate Guide for Beginner ...
Want to learn how to code but unsure where to start? Welcome to coding for beginners. This guide includes languages, resources, and valuable ......
Read more >50+ Top Interview Questions and Answers in 2022 | The Muse
We've compiled a list of 50+ common interview questions you might be asked—plus advice on how to answer each and every one of...
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
Same thing here, using the bower version.
@creativewax - You’re talking about Issue #526