镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Iphone IOS10 Safari array map function not work in react render  #200

Open

Description

@ximing

React Easy State version: 7.0.0-alpha.1
Platform: Iphone IOS10 Safari

Describe the bug
in ios10 safari ,
use store wrap a array,
in react render function ,use this array's map function not render item

This is the right situation

image

This is the problematic situation

image

This is the source code
const datas = store({ list: [{ a: 1 }, { a: 2 }] });

function App() {
  const items = [];
  datas.list.forEach(item => {
    items.push(<div key={item.a}>{item.a}</div>);
  });
  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      {datas.list.map(item => {
        return <div key={item.a}>{item.a}</div>;
      })}
      <div>===============</div>
      {items}
    </div>
  );
}

export default view(App);

For tougher bugs

To Reproduce

https://codesandbox.io/s/react-easy-state-alpha-42dgc?file=/src/App.js


Activity

  1. ximing commented on Jul 16, 2020

    @ximing
    Author

    I added the following code

    console.log(items, [...datas.list.map(item=><div key={item.a}>{item.a}</div>)])

    Safari IOS10 print
    image

    Chrome print
    image

  2. ximing commented on Jul 17, 2020

    @ximing
    Author

    The error should have occurred in this package @nx-js/observer-util
    in observable.js file remove typeof child === 'function' IOS10 is OK
    image

    This is the first time I have checked the source code of this package, it is not clear why this happens

  3. ximing commented on Jul 21, 2020

    @ximing
    Author

    Is caused by this nx-js/observer-util#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions