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.

Trying to get a basic example working

See original GitHub issue

Hi, 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:closed
  • Created 8 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
aldanorcommented, Jun 23, 2015

Same thing here, using the bower version.

0reactions
TigerC10commented, Oct 28, 2015

@creativewax - You’re talking about Issue #526

Read more comments on GitHub >

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

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