1

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

2 Answers 2

1

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);
Sign up to request clarification or add additional context in comments.

Comments

0

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);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.