benwiley4000 / react-dot-fragment Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Use React 16's <React.Fragment> in React 15
Home Page: https://benwiley4000.github.io/react-dot-fragment/
License: MIT License
๐ฆ Use React 16's <React.Fragment> in React 15
Home Page: https://benwiley4000.github.io/react-dot-fragment/
License: MIT License
This one was overlooked! ๐ฎ
The use of the DOM api to polyfill fragment means this isn't usable on other platforms.
I'm curious if that is compatible with Preact and Inferno and so on.
In theory it should work if React is aliased ๐ค
This way we don't have to worry about old browsers not supporting this or uglifiers throwing a fit.
Suggestion:
I think we should remove wrapper itself, after all children has been unwrapped
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
});
};
Using this package causes re-renders and as a result input fields lose focus
React.Fragment
: https://codepen.io/anon/pen/WmMPBOA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.