Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

[BUG] 节点更新后属性不一致导致报错 #1065

Closed
dominicleo opened this issue Jun 9, 2020 · 1 comment · Fixed by #1066 or #1078
Closed

[BUG] 节点更新后属性不一致导致报错 #1065

dominicleo opened this issue Jun 9, 2020 · 1 comment · Fixed by #1066 or #1078
Assignees
Labels
bug Something isn't working

Comments

@dominicleo
Copy link
Contributor

dominicleo commented Jun 9, 2020

bug 描述

import * as React from 'react';
import { useNativeEffect } from 'remax';

const Page = () => {
  const [state, setState] = React.useState(false);

  useNativeEffect(() => {
    setTimeout(() => setState(true), 2000);
  }, [])

  if (!state) {
    return (
      <View className={s.wrapper}>
        <View className={s.doctor}>
          <View className={s.details}>
            <View className={s.avatar} />
            <View>
              <View className={s.name} />
              <View className={s.title} />
            </View>
          </View>
          <View className={s.fields}>
            <View className={s.field} />
            <View className={s.field} />
            <View className={s.field} />
          </View>
        </View>
      </View>
    )
  }

  return (
    <View className={s.wrapper}>
      <View className={s.doctor}>
        <View className={s.details}>
          <View className={s.avatar} style={{ backgroundImage: `url(example.png)`}} />
          <View>
            <View className={s.name} />
            <View className={s.title} />
          </View>
        </View>
        <View className={s.fields}>
          <View className={s.field} />
          <View className={s.field} />
          <View className={s.field} />
        </View>
      </View>
    </View>
  )
}

版本信息:

  • remax 版本: [e.g. 2.4.0]
    微信截图_20200609163601
@dominicleo dominicleo added the bug Something isn't working label Jun 9, 2020
dominicleo added a commit to dominicleo/remax that referenced this issue Jun 10, 2020
dominicleo added a commit to dominicleo/remax that referenced this issue Jun 10, 2020
dominicleo added a commit to dominicleo/remax that referenced this issue Jun 10, 2020
dominicleo added a commit to dominicleo/remax that referenced this issue Jun 10, 2020
@yesmeck yesmeck reopened this Jun 15, 2020
@dominicleo
Copy link
Contributor Author

bug 描述

import * as React from 'react';
import { View } from 'remax/one';
import s from './index.css';

export default () => {
  const [loading, setLoading] = React.useState(false);
  const [list, setList] = React.useState(Array.from(Array(10).keys()));
  const isMore = list.length > 5;

  const onRequest = async () => {
    setLoading(true);
    await new Promise((resolve) => setTimeout(resolve, 1500));
    setLoading(false);
    setList(Array.from(Array(2).keys()));
  };

  return (
    <View className={s.wrapper} onTap={onRequest}>
      <View>
        {isMore && (
          <View contentPosition='center' hairline>
            {loading ? <View>loading</View> : '没有更多了'}
          </View>
        )}
      </View>
    </View>
  );
};

版本信息
remax 版本: [e.g. 2.4.1]
lALPD2sQsT0-eZ_NA9DNBWw_1388_976

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants