Comments (12)
It's definitely low on my wishlist though - the critical thing (IMO) is sorting out the life-cycle events. Once that's done, I can actually start building my app with this ๐
from superfine.
You mean "the community" would prefer to rewrite my example as ๐ฎ
const MyList = props =>
</>
<p>A</p>
<p>B</p>
<p>C</p>
</>
?
from superfine.
?
Apparently, yeah ๐
from superfine.
@mindplay-dk Hmm, not really sure I'd want this at all, but why? What are the benefits; how does this help me make apps?
from superfine.
It enables you to implement functional components that return a range of elements - in other words, you're not longer forced to start every component with a (sometimes dummy) wrapper element.
Anyways, it's what JSX is now - it's already supported both by Babel and Typescript.
from superfine.
@mindplay-dk It enables you to implement functional components that return a range of elements - in other words, you're not longer forced to start every component with a (sometimes dummy) wrapper element.
We can create components that return a range of elements already!
const MyList = props => [<p>A</p>, <p>B</p>, <p>C</p>]
What we don't currently support is patching a root node that it itself is an array.
from superfine.
We can create components that return a range of elements already!
I know, but that's kind of ugly, and it's not how the JSX community wants to do it.
What we don't currently support is patching a root node that it itself is an array.
React also does not support that, as far as I know - the point of JSX fragments, if I understand correctly, is merely to be able to create a range of elements using XML-like JSX syntax, without having to wrap it in braces and brackets.
Anyhow, as said, this is definitely not a high priority for me, personally - but the community has decided they want this, and it's likely not much work to support it, especially if you factor your new implementation so it consistently operates on sets.
I'm much more interested in solving the ordering issues, for one :-)
from superfine.
the syntax is
const MyList = props =>
<>
<p>A</p>
<p>B</p>
<p>C</p>
</>
and the main advantage is text nodes. people rather write <>hello<hr/></>
over ['hello', <hr/>]
from superfine.
@Pyrolistical What does it compile to?
from superfine.
i don't understand your question, <>hello<hr/></>
compiles to the same thing as ['hello', <hr/>]
from superfine.
Well, that answers the question. Thanks!
from superfine.
Apparently in order to support this you need to expose a function and set it to paramFrag
https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-react-jsx/README.md
from superfine.
Related Issues (20)
- Is using custom `events` property for DOM element really future proof? HOT 3
- Is superfine a shared core of both hyperapp v1/v2 ? HOT 6
- Reference from a new virtual DOM framework project based on superfine HOT 2
- Is there any way superfine JSX/HyperScript code work on iOS/Android natively like React-Native? HOT 2
- This again: stateful components? ๐คจ HOT 16
- if-else case caused every element update HOT 1
- Lifecycle Events HOT 35
- Missing superfine.d.ts HOT 2
- Is v6 officialy depredated? HOT 2
- Usage of Props HOT 7
- V7 and Document Fragments HOT 20
- patch doesn't replace id of target node HOT 2
- node.setAttribute is not a function HOT 9
- Lifecycle events using Mutation Observer HOT 1
- Minimum example of a table with some sorting HOT 5
- Potential bug when recycling nested elements HOT 1
- Support for React-like `ref`s? HOT 23
- element handlers don't work on root nodes HOT 1
- I create a minimalistic component based framework on the top of superfine HOT 1
- Discussion about patching shadow-root nodes? Feature request?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superfine.