Preact: Rendering array of elements results in undefined

Created on 16 Mar 2018  路  7Comments  路  Source: preactjs/preact

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.

Most helpful comment

Preact currently does not support render array. It's on the todo list though

All 7 comments

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(, container) fails.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewmueller picture matthewmueller  路  3Comments

k15a picture k15a  路  3Comments

skaraman picture skaraman  路  3Comments

KnisterPeter picture KnisterPeter  路  3Comments

kossnocorp picture kossnocorp  路  3Comments