Usage "h" function in examples #3123
-
Hi! What sense of "h" function there? |
Beta Was this translation helpful? Give feedback.
Answered by
JoviDeCroock
Apr 20, 2021
Replies: 2 comments 1 reply
-
It's a transpilation support, basically JSX isn't valid JS so when your transpiler comes into play this component will be transformed to: // From
const HelloWorld = () => <p>Hello world</p>
// TO
const HelloWorld = () => h('p', {}, 'Hello world'); So basically so |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ForsakenHarmony
-
Okey, thanks. I think docs lacks of example like this |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a transpilation support, basically JSX isn't valid JS so when your transpiler comes into play this component will be transformed to:
So basically so
h
is defined within the scope