Giter Site home page Giter Site logo

Comments (3)

HowardTangHw avatar HowardTangHw commented on May 13, 2024 1

@chachaxw
我的解决方法是这样的

const usePatchData =(type)=>{
  const [count,setCount]=useState(0);
  useEffect(()=>{
    // call api on this line
    console.log(type);
   },[count])


  function onRefreshPatchData(){
    setCount(pre=>pre+1);
  }
  return [onRefreshPatchData];
}


const [type,setType]=useState('A');
const [onRefreshPatchData] = usePatchData(type);


onRefresh((toggled) => {
  onRefreshPatchData();
}

需要加上一些checking,因为会比较频繁的调用到onRefreshPatchData

from react-native-scrollable-tabview.

chachaxw avatar chachaxw commented on May 13, 2024

@HowardTangHw @itenl 这个问题有解决办法吗?我也碰到了这个问题,感觉是个大坑,useRefreshEndReached 里面所有的方法都有这个问题

from react-native-scrollable-tabview.

chachaxw avatar chachaxw commented on May 13, 2024

@HowardTangHw 我这边有个问题就是,调用 onReachEnd 方法的时候,回调函数执行有点奇怪,本来是加载更多数据,有时候能加载,有时候又加载不出来

from react-native-scrollable-tabview.

Related Issues (9)

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.