Coder Social home page Coder Social logo

benwiley4000 / react-dot-fragment Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 2.0 171 KB

๐Ÿฆ„ Use React 16's <React.Fragment> in React 15

Home Page: https://benwiley4000.github.io/react-dot-fragment/

License: MIT License

JavaScript 100.00%
ponyfill react polyfill fragment dom hacks

react-dot-fragment's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-dot-fragment's Issues

Use Babel

This way we don't have to worry about old browsers not supporting this or uglifiers throwing a fit.

Remove wrapper after all children has unwrapped

Suggestion:
I think we should remove wrapper itself, after all children has been unwrapped

Problem:
image

Possible solution:

_proto.unwrapChildren = function unwrapChildren() {
    var _this2 = this;

    // defer first to style calculation to ensure CSS transitions can happen:
    // https://stackoverflow.com/a/24195559/4956731
    setTimeout(function () {
      // plain js rocks!
      // https://plainjs.com/javascript/manipulation/unwrap-a-dom-element-35/
      if (!_this2.div.parentNode) {
        return;
      }

      _this2.saveFocusedDescendantElement(_this2.div);

      _this2.orphans = [];

      while (_this2.div.firstChild) {
        _this2.orphans.push(_this2.div.firstChild);

        _this2.div.parentNode.insertBefore(_this2.div.firstChild, _this2.div);
      }

      _this2.restoreFocusedDescendantElement();

      _this2.div.remove();  // <- Something like this
    });
  };

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.