V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  ethusdt  ›  全部回复第 52 页 / 共 104 页
回复总数  2068
1 ... 48  49  50  51  52  53  54  55  56  57 ... 104  
❮ ❯
2022 年 2 月 23 日
回复了 ethusdt 创建的主题 › React › React effects 的闭包里锁定 state 值是怎么实现的?
@dcsuibian 这和 a++ setA(Math.random()) 没关系...
2022 年 2 月 23 日
回复了 ethusdt 创建的主题 › React › React effects 的闭包里锁定 state 值是怎么实现的?
@zzuieliyaoli Dan 的这篇我看了, 只是说了下这个现象, 并没有讲是怎么实现的.
2022 年 2 月 23 日
回复了 ethusdt 创建的主题 › React › 为什么 react 中 effect cleanup 是在每次 re-render 之后再调用?
@charlie21 嗯, 应该是这样的, UI 渲染第一位.
2022 年 2 月 22 日
回复了 461da73c 创建的主题 › 职场话题 › 4 月底才发年终奖
四月底给你个惊喜
2022 年 2 月 20 日
回复了 ethusdt 创建的主题 › React › 请教 react-redux 中 connect 的实现
@otakustay 我明白了. 原来并不是 store 改变 <Provider>下面所有的 tree 都需要 update:

> Because each connected component should only re-render when its nearest connected ancestor component has rendered.

https://github.com/reduxjs/react-redux/discussions/1875#discussioncomment-2210998
2022 年 2 月 20 日
回复了 ethusdt 创建的主题 › React › 请教 react-redux 中 connect 的实现
@otakustay 你还是没有看源码,「没有 Provider 就拿不到 store 」是的, 所以 react-redux 在最外层的 Provider 使用了 <Context.Provider> :

https://github.com/reduxjs/react-redux/blob/master/src/components/Provider.tsx

但是在 connect 中, 它 wrap 的组件外再套了一层 <ContextToUse.Provider> , 难道不是应该套一层 <Consumer> 吗?
2022 年 2 月 19 日
回复了 ethusdt 创建的主题 › React › 请教 react-redux 中 connect 的实现
@otakustay 这种简单实现我也懂, 我是不明白源码中为何要多套一层 <ContextToUse.Provider>:

Provider:
const Context = React.createContext(null);
function Provider(store, children) {
return <Context.Provider value={contextValue}>{childeren}</Context.Provider>
}


const connect = (mapState, mapDispatch) => {
return ComponentIn => props => {
const state = useSelector(mapState);
const dispatch = useDispatch();
const methods = mapDispatch(dispatch);
return (
<ContextToUse.Provider value={overriddenContextValue}>
<ComponentIn {...props} {...state} {...methods} />;
</ContextToUse.Provider>
);
};
}
2022 年 2 月 19 日
回复了 ethusdt 创建的主题 › React › 请教 react-redux 中 connect 的实现
const compose = (...funcs) =>
funcs.reduce((a, b) => (...args) => a(b(...args)), arg => arg)

问题 2, 难道是为了 functional programming ?
@Bijiabo 谢谢回复. 还是有几个问题:

```
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"AwesomeProject"
initialProperties:nil];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
```

这是使用 RN 创建的项目, 里面只有一个 rootViewController. 它是如何(在哪里)实现 `将 NavigationController 的 View 作为 child view` 的? 是不是在编译 .h .m 时候给替换掉了? 具体是怎么完成的?

在 js 里写了很多 view, 使用原生的 navigation 跳转新的页面, 数据传输不会有影响吧? RN 的 js 那边都是一个 runtime, 比如要 push 新的页面, 在原生端得有一个 Controller 的生命周期, didLoad 后再将 RN 的 view 设置为它的 view? 还需要 bridge 来获取 RN 的 view 吗?
2022 年 2 月 10 日
回复了 ethusdt 创建的主题 › 问与答 › 你们习惯这种地图指示吗?
@0312birdzhang 地图线上看不到当前路(汽车自带导航), 或者加载的特别慢.
2022 年 2 月 9 日
回复了 ethusdt 创建的主题 › 问与答 › 你们习惯这种地图指示吗?
苹果地图和汽车自带地图最大的好处是没有广告.
2022 年 2 月 9 日
回复了 ethusdt 创建的主题 › iOS › 使用 M1 做 iOS 开发遇到 pod install ruby 问题你们都怎么解决?
@Building RN 还是用的 pod..


@xoioao 谢谢 我试试.
2022 年 2 月 8 日
回复了 Apple2023 创建的主题 › iPhone › 春节出行,你觉得高德好用还是百度好用?
@xieshaohu 「限速拍照提醒, 左侧车道能否直行(请走右侧 3 车道), 路口提前提醒变道(尤其下高速)」 这几个功能 苹果地图有提示吗?
2022 年 2 月 8 日
回复了 Livid 创建的主题 › PHP › Files Gallery
像这些工具, op 是从什么渠道得知的?
2022 年 1 月 16 日
回复了 ethusdt 创建的主题 › 美酒与美食 › 谁能知道这是什么面?
@UnmeiDokiDoki 好像是的, 名字很熟悉. 但不是很确定.
2022 年 1 月 15 日
回复了 ethusdt 创建的主题 › 美酒与美食 › 谁能知道这是什么面?
@YuxiangLuo 也不是
2022 年 1 月 15 日
回复了 ethusdt 创建的主题 › 美酒与美食 › 谁能知道这是什么面?
@hfJ433 不是… 这是哪年的? 怎么找到的图片
2022 年 1 月 13 日
回复了 h1104350235 创建的主题 › React › React 项目
2022 年 1 月 13 日
回复了 ethusdt 创建的主题 › 问与答 › 安卓手机插到电脑狂闪 usb 选项, 如何解决?
@hikari 是 mac 大概率 bug 了..

@wasd6267016
@geniussoft OK 也有可能
2022 年 1 月 13 日
回复了 ethusdt 创建的主题 › 问与答 › 安卓手机插到电脑狂闪 usb 选项, 如何解决?
@iFlicker 是小米… miui12.5.3
1 ... 48  49  50  51  52  53  54  55  56  57 ... 104  
❮ ❯
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2281 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 12:46 · PVG 20:46 · LAX 04:46 · JFK 07:46
♥ Do have faith in what you're doing.