GithubHelp home page GithubHelp logo

Comments (5)

acdlite avatar acdlite commented on June 21, 2024

Can you show me the entire snippet, please?

from recompose.

leesiongchan avatar leesiongchan commented on June 21, 2024
const mapProps$ = props$ => {
  const items$ = props$
    .map(props => props.items)
    .startWith([]);

  return Rx.Observable.combineLatest([
    items$,
  ], (items) => ({
    items,
  }));
};

const Item = ({ item }) => (
  <li>Hello, my name is {item.name}.</li>
);

const EnhancedItem = observeProps(mapProps$)(Item);

const List = ({ items }) => (
  <ul>
    {items.map(item => <EnhancedItem item={item} />)}
  </ul>
);

const items = [{
  name: 'Bruce Lee',
}, {
  name: 'Brad Pitt',
}, {
  name: 'Leonardo DiCaprio',
}];

const TestPage = () => (
  <div>
    Featured celebrities subscribed to our site:
    <List items={items} />
  </div>
);

And it looks ok in React debugging tool.
screen shot 2015-11-18 at 9 44 35 am

And here is the error message.
screen shot 2015-11-18 at 9 47 26 am

from recompose.

acdlite avatar acdlite commented on June 21, 2024

Huh, that's weird....

Maybe there's something funky going on with Babel. What happens if you change Item to:

const Item = props => (
  <li>Hello, my name is {props.name}.</li>
);

If that still doesn't work, log the props object and see what's inside.

from recompose.

leesiongchan avatar leesiongchan commented on June 21, 2024

Sorry is my typo for mapProps suppose to returns item not items. It works, but I will check again before close.

from recompose.

acdlite avatar acdlite commented on June 21, 2024

Ah right, I see that now. Glad you figured it out.

from recompose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.