Code Monkey home page Code Monkey logo

Comments (5)

joshfarrant avatar joshfarrant commented on June 4, 2024 1

😑 ... Don't know why that hadn't occurred to me - cheers all! 👍

from react-animations.

joshfarrant avatar joshfarrant commented on June 4, 2024

Any thoughts on this? Would a PR from me help move this along?

from react-animations.

ryan-roemer avatar ryan-roemer commented on June 4, 2024

Weird question -- can't someone just do:

import * as animations from 'react-animations';

At least in the babel world transpiling, something like:

// src/mod.js
export const foo = "foo";
export const bar = "bar";
export const num = 42;

// src/index.js
import * as mod from "./mod";

Object.keys(mod).forEach((key) => {
  console.log("TODO HERE", key, mod[key]);
});

when transpiled and run produces output like:

$ node lib/index.js 
TODO HERE foo foo
TODO HERE bar bar
TODO HERE num 42

/cc @mattcubitt

from react-animations.

mattcubitt avatar mattcubitt commented on June 4, 2024

Hi @joshfarrant yes you can use:

import * as animations from 'react-animations';

I think this would be a better solution than maintaining a list of animations on the default export.

from react-animations.

aweary avatar aweary commented on June 4, 2024

I agree that import * is the right way to do this, since conceptually there isn't any default export for react-animations

from react-animations.

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.