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

Preact render undefined element #574

Closed
sxcooler opened this issue Mar 2, 2017 · 1 comment
Closed

Preact render undefined element #574

sxcooler opened this issue Mar 2, 2017 · 1 comment

Comments

@sxcooler
Copy link

sxcooler commented Mar 2, 2017

import {h, Component} from 'preact';

export default class PropList extends Component {
	render() {
		const aaa = ['a', 'b', 'c'];
		const list = aaa.map((item, index) => {
			return <div>foo bar</div>
		});
		console.log(list);
		return {list};
	}
}

my project is based on https://github.com/developit/preact-boilerplate and I put this into app.js Router part.

<PropList path="/test"/>

and I get this:
image
that "undefined" is my PropList.

@sxcooler
Copy link
Author

sxcooler commented Mar 2, 2017

sorry, my fault.
I found this: #45
and this: http://stackoverflow.com/questions/32157286/rendering-react-components-from-array-of-objects
and I should review this: https://facebook.github.io/react/docs/lists-and-keys.html

@sxcooler sxcooler closed this as completed Mar 2, 2017
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

1 participant