Reputation: 11677
I want to create a container with simple html template like this:
<div>
<one />
<two />
<three />
</div>
thats all... so how do I use a container with creating it with
connect(mapStateToProps,mapDispatchToProps)(ViewComponent);
as in this way, I have no option for regular render...
any ideas?
thanks
Upvotes: 1
Views: 257
Reputation: 836
I would use Stateless function instead of component:
import React from 'react';
const Foo = () => (
<div>
<one />
<two />
<three />
</div>
);
Foo.propTypes = {};
const mapStateToProps = () => {}
const mapDispatchToProps = {}
export default connect(mapStateToProps,mapDispatchToProps)(Foo);
Upvotes: 0
Reputation: 3384
You can code like this:
import {one} from ""
import {two} from ""
import {three} from ""
import {component} from react
import {connect} from react-redux
export default class ViewComponent extends component
{
constructor(props)
{
super(props)
}
render()
{
return(
<one />
<two />
<three />
);
}
}
connect(mapStateToProps,mapDispatchToProps)(ViewComponent);
Upvotes: 1