Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering array of elements results in undefined #1039

Closed
joeyhub opened this issue Mar 16, 2018 · 7 comments
Closed

Rendering array of elements results in undefined #1039

joeyhub opened this issue Mar 16, 2018 · 7 comments

Comments

@joeyhub
Copy link

joeyhub commented Mar 16, 2018

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.

@joeyhub
Copy link
Author

joeyhub commented Mar 16, 2018

It's because your render function isn't compatible. It has no callback.

@joeyhub
Copy link
Author

joeyhub commented Mar 16, 2018

It's also now putting "undefined" into the DOM for an application that worked with react.

@yaodingyd
Copy link
Collaborator

Can you show your entire codes/repo?

@joeyhub
Copy link
Author

joeyhub commented Mar 19, 2018

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.

@joeyhub
Copy link
Author

joeyhub commented Mar 19, 2018

It's just returning undefined when you pass in arrays.

@yaodingyd
Copy link
Collaborator

yaodingyd commented Mar 19, 2018

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

@yaodingyd yaodingyd changed the title Tries to render any JS variable. Rendering array of elements results in undefined Mar 19, 2018
@developit
Copy link
Member

Closing as duplicate of #929 / #946.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants