Code Monkey home page Code Monkey logo

Comments (4)

FlatMapIO avatar FlatMapIO commented on May 18, 2024

Here https://gist.github.com/huodon/b73962bf606a28913e0c

But it seems that some error.

import * as ReactGridLayout;

console.log(ReactGridLayout); // This not a ReactComponent. 

console.log(ReactGrideLayout.Responsive); // is valid

from react-grid-layout.

erfangc avatar erfangc commented on May 18, 2024

@huodon Works fine for me, weird that I didn't even need the legacy cjs import syntax of import ReactGridLayout = require('react-grid-layout');

What does your tsconfig.json file look like?

mine is:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es3",
        "noImplicitAny": false,
        "sourceMap": false
    },
    "exclude": [
        "node_modules",
        "jspm_packages"
    ]
}

the transpiled ES3 looks like:

var ReactGridLayout = require('react-grid-layout');
console.log(ReactGridLayout);

from react-grid-layout.

erfangc avatar erfangc commented on May 18, 2024

@huodon btw, there are compilation errors in the definition file, specifically, we React.Component and React.ReactElement etc needs to be parametrized i.e. replace React.Component with React.Component<T>

from react-grid-layout.

STRML avatar STRML commented on May 18, 2024

We now have Flow typing - please reopen as a PR if you have a .d.ts you'd like to contribute.

from react-grid-layout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.