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

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

Open
ximing opened this issue Jul 16, 2020 · 3 comments
Open

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

ximing opened this issue Jul 16, 2020 · 3 comments
Labels

Comments

@ximing
Copy link

ximing commented Jul 16, 2020

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


@ximing ximing added the bug label Jul 16, 2020
@ximing
Copy link
Author

ximing commented Jul 16, 2020

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

@ximing
Copy link
Author

ximing commented Jul 17, 2020

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

@ximing
Copy link
Author

ximing commented Jul 21, 2020

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
Labels
Projects
None yet
Development

No branches or pull requests

1 participant