Comments (20)
Cool! I am by no means a JSX expert, I just tried the changes in your pen and it worked. TIL for me as well. :-)
from hyperapp.
I noticed. By the way, when do you sleep?
from hyperapp.
Now I did the todos example: http://codepen.io/rbiggs/pen/BpOoNz
Making this link back to here.
from hyperapp.
I'd say it's best to automatically convert case for users to avoid unintended errors. Typing habits can be hard to break.
from hyperapp.
@jbucaran I just meant False Alarm. I made a typo π
from hyperapp.
@rbiggs Yes, I'm fixing them now. π
from hyperapp.
JSX one is working already. http://codepen.io/jbucaran/pen/ggjBPE
from hyperapp.
from hyperapp.
@rbiggs All examples updated.
For those interested in the new HyperApp + JSX integration, check out this collection of pens.
from hyperapp.
I forked your Codepen counter example and made it pretty :-P. http://codepen.io/rbiggs/pen/zNJGNz
from hyperapp.
@rbiggs Sweet! π
from hyperapp.
@jbucaran @rbiggs I am running into some weird issue with JSX.
The initial component renders fine, but no events fire any updates π€
http://codepen.io/selfup/pen/WRgOrR?editors=0110
from hyperapp.
I believe your events should be onclick
instead of onClick
, and likewise for onkeyup
and onkeydown
.
from hyperapp.
I tried that, but I can try again. I was under the impression that JSX preffered onClick
? TIL π
from hyperapp.
@tzellman omg that totally worked (for the most part, still having event issues haha)! I guess React prefers onClick
vs. onclick
so that is what i was used to π
from hyperapp.
@selfup JSX is transformed to createElement
, which is the agent parsing the string "onClick".
Similarly, with HyperApp, when using the pragma comment directive /** jsx h */
, the one parsing the event name is the function h
which returns a virtual node. The function that processes that virtual node and actually creates a DOM element may be our own createElement or updateElement.
We could simply introduce a prop.toLowerCase()
... π€
from hyperapp.
@jbucaran that could be very nice! Nice thought
from hyperapp.
Ok whew I just made a mistake editing when using cmd + d
I had:
const direction = e.target.classNameName;
instead of className
π€£
Now all the colors change as they should!
False β°
from hyperapp.
@selfup False β°
You mean something's broken? π€
from hyperapp.
@rbiggs Okay.
The relevant code is probably this.
Can you make a PR w/ that? I'll merge-ge-ge it.
from hyperapp.
Related Issues (20)
- A way to insert raw Html HOT 1
- TypeError: can't access property 0, newSubs is null, when setting the state to undefined. HOT 4
- Issue with null-vnodes HOT 1
- prevent rerender node HOT 2
- The dispatch initializer ends in an endless loop on init when dispatching any action HOT 7
- Injected classes gets removed when using object/array to define class props HOT 1
- hyperapp version HOT 3
- Memo Data Gotcha HOT 5
- Confusing doc for actions -> wrapped actions HOT 5
- Passing arguments to init HOT 4
- [Question] Headless mode is still possible? HOT 1
- Destroying a child app HOT 8
- @hyperapp/html: use a Proxy? HOT 9
- Actions returning other Actions HOT 5
- Compile template tag to hyperscript HOT 17
- A challenge to hyperapp community HOT 1
- Has 2.0 been dropped from development? HOT 3
- oldSub[2] is not a function HOT 3
- Cannot read properties of null (reading 'length') HOT 5
- Unlikely Use Case bug in HTML and SVG Packages HOT 9
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 hyperapp.