Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

React is undefined when loading React with a script tag #8

@ronaldborman

Description

@ronaldborman

When I explore a new library, I like to use a webpage, load the library and all dependencies with script tags and write example code in a script tag.

In React-Formly 0.0.4 this setup worked, but in 0.0.5/Master I get an "Cannot read property 'createClass' of undefined" error on line 16 of Formly.js ("var Formly = React.createClass"). While the browser indicates that React is undefined, React is available on the global object (a.k.a. window).

I suspect that this is a side effect of commit e943db6. Unfortunately my knowledge of Webpack is limited, so I cannot suggest a comprehensive change.

I realize that the use case for using script tags is limited (essentially only exploration), but I think it's valid enough to include it in React Formly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions