You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across a problem, when compiling with bili and using render functions inside a tsx file.
The first proble mis, that the emitted code for h is React.createElement. I have this in my tsconfig.json:
"jsx": "preserve",
"jsxFactory": "h",
I found, that using this is needed for bili.config.ts:
babel: {configFile: false,jsx: 'h',},
Now that React.createElement is "replaced" by h, it still doesn't work if the initial render function calls other functions, that also return TSX, e.g. like this:
In this case, renderSubContent throws an error, that h is not defined. If I add const h = this.$createElement manually to the function, there are no errors but also nothing gets rendered at all.
The text was updated successfully, but these errors were encountered:
I came across a problem, when compiling with bili and using render functions inside a tsx file.
h
isReact.createElement
. I have this in mytsconfig.json
:I found, that using this is needed for
bili.config.ts
:React.createElement
is "replaced" byh
, it still doesn't work if the initialrender
function calls other functions, that also return TSX, e.g. like this:In this case,
renderSubContent
throws an error, thath is not defined
. If I addconst h = this.$createElement
manually to the function, there are no errors but also nothing gets rendered at all.The text was updated successfully, but these errors were encountered: