I have something like x = function(), etc in my jsx file and when I try to switch from react to preact it seems to think that's a JSX node.
It's because your render function isn't compatible. It has no callback.
It's also now putting "undefined" into the DOM for an application that worked with react.
Can you show your entire codes/repo?
I'm not really doing anything fancy. I just want a minimal preact setup.
It's just putting in
"babel-plugin-transform-react-jsx": "^6.24.1",
"preact": "^8.2.7",
{
test: /\.jsx?$/,
use: [{
loader: "babel-loader",
options: {plugins: [["transform-react-jsx", {pragma: "h"}]]}
}]
}
Then just render(
It's just returning undefined when you pass in arrays.
Preact currently does not support render array. It's on the todo list though
Closing as duplicate of #929 / #946.
Most helpful comment
Preact currently does not support render array. It's on the todo list though