ant-design / ant-design-mobile-rn

Ant Design for React Native

Home Page:https://rn.mobile.ant.design/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

新版计划(The new plan) 3.0.0 - Discussion

BANG88 opened this issue · comments

  • General

    • Upgrade react-native and other dependencies to the latest version
    • bug fixes
    • Improve the documentation (use expo to preview or provide Gif) CodeSandBox
  • Refactoring

    • File naming (remove the native suffix)
    • More friendly theme support, user-friendly
    • Improve TypeScript type definitions
    • Split the components in react-component (previously shared with the Web)

  • 常规

    • 升级 react-native 以及其他依赖到最新版
    • bug修复
    • 完善文档(看是否可以使用expo来预览,不然就只能提供Gif了) CodeSandBox
  • 重构

    • 文件命名(去掉native后缀)
    • 更友好的主题支持,方便用户自定义
    • 完善TypeScript 类型定义
    • 拆分react-component里面的组件(之前是跟Web共用的)

能换个帅气的包名吗

这个应该可以吧 cc @warmhug

先想想什么包名比较好啊?要不投个票~ 换的话 影响还是比较大的

不要换包名

@warmhug @BANG88 react-native-antd 怎样

@Manweill 换的话是会有不同意见的. 换成什么也是问题. 后面开一个issue然后看看反馈可好? 这里还是先讨论一下主要问题

@BANG88
那提一个全局自定义样式的配置吧,类似Nativebase

想用 React 16 的context来做. 实现一个自定义的ThemeContext

主要是提供能自定义配色的功能。现在改按钮颜色太麻烦了。

还有就是 List 组件的上下border,很多场景是不需要的,grid的图片大小需要自定义,item的thumb尺寸也太小,需要自定义

计划里面已经有了

更友好的主题支持,方便用户自定义

@youngjuning 可以整理一下列表这些看起来问题都不大.

期待,主要是很多有用的props都没有暴露,希望能给开发者更多的自定义权限

能支持tree组织架构树的组件吗

我觉得APP上展示树结构不显示,可以做个类似文件目录那样的导航会好点

expo 的 demo 无法查看了,还有官网怎么会这么慢😂

如果换包名,可以用 @ant-design/react-native

expo 的 demo 无法查看了,还有官网怎么会这么慢😂

可以使用,今天刚测。

modal/action-sheet/picker使用原生动画modal动画提高性能,还有建议自定义动画单独整一个配置文件,现在动画还会回弹一下,不友好,在安卓上表现不好;
action-sheet不能修改动画时长animationDuration
checkbox的图片不能自定义?
弹出modal之后不支持在弹一个toast/loading(modal最高层级)并且只能弹出一个,建议
内部依赖的react-native-top-view 建议能使用数组方式多弹几个组件,比如现在弹出loading的时候不能弹出toast
还有就是建议优化一下picker,在安卓上体验不是很好,数据量多的时候动画性能表现不好
picker在使用做省市区的时候,建议回调函数参数是整个item,现在好像给的是id?
picker在做省市区的时候,固定了label和value字段,建议能够自定义字段
button等点击处理事件在安卓上能否可选使用TouchableNativeFeedback?提高安卓用户体验

大幅度提高性能,吃透react-native API,感觉整个组件用下来性能不是很好

更完善的文档,现在有的props只能查看源码才能了解具体的作用。。

组件可见的样式建议都能提供自定义,例如字体大小、边框、颜色、placeholder等等

暂时就想到这么多,望各位大佬采纳。。

For:

Improve the documentation (use expo to preview or provide Gif)

may I suggest Storybook?
https://storybook.js.org/basics/guide-react-native/

maybe this can be used to automate taking screenshots of all the components? 😎
https://github.com/oblador/loki

Thanks @gianpaj

Will use CodeSandbox after this get fixed codesandbox/codesandbox-client#1293

像portal这种组件也可以export出来,想借助这个做一些自定义的modal层

像portal这种组件也可以export出来,想借助这个做一些自定义的modal层

对,而且加了两种方式创建自定义的层。方便自己扩展

像portal这种组件也可以export出来,想借助这个做一些自定义的modal层

对,而且加了两种方式创建自定义的层。方便自己扩展

目前还没有export出来吧,还是已经有了,但是我没找到..

还在测试过程中,后面稳定了会export出来。

Install the beta version with yarn add @ant-design/react-native@next

If you haven't used Provider before, you need to add Provider to the app entry to support the latest version of the theme.

eg:

import { Provider } from '@ant-design/react-native'
return (
      <IntlProvider>
        <AppThemeProvider value={theme}>
          {t => (
            <Provider >
              ...
            </Provider>
          )}
        </AppThemeProvider>
      </IntlProvider>
    )

Feedback is the best support for me. and documentation also needs more help too. 😄

tabs 组件有一个很普遍的问题,就是某个选项卡的内容比较长,另一个选项卡内容区域的底部就会留下很长的空白,这个有办法解决么?

Please file an issue directly.

调用

Modal.operation([
       { text: "标为未读", onPress: () => console.log("标为未读被点击了") },
       { text: "置顶聊天", onPress: () => console.log("置顶聊天被点击了") }
])

报错:
Invariant Violation: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

This error is located at:
in RCModal
in RCTView (at View.js:60)
in View
in WithTheme (created by AntmModal)
in AntmModal
in WithTheme (created by OperationContainer)
in OperationContainer
in RCTView (at View.js:60)
in View (created by PortalManager)
in PortalManager (created by Portal.Host)
in Portal.Host (created by Provider)
in ThemeProvider (created by Provider)
in LocaleProvider (created by Provider)
in Provider (at router.js:150)
in Router (created by Connect(Router))
in Connect(Router) (at index.js:18)
in Provider (at dva.js:17)
in Unknown (at renderApplication.js:33)
in RCTView (at View.js:60)
in View (at AppContainer.js:102)
in RCTView (at View.js:60)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:32)

tabs 组件有一个很普遍的问题,就是某个选项卡的内容比较长,另一个选项卡内容区域的底部就会留下很长的空白,这个有办法解决么?

两个内容都用ScrollView包一下

@BANG88 3.0可以用custom font吗? 貌似default theme里面没有'fontFamily' variable

调用

Modal.operation([
       { text: "标为未读", onPress: () => console.log("标为未读被点击了") },
       { text: "置顶聊天", onPress: () => console.log("置顶聊天被点击了") }
])

报错:
Invariant Violation: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

This error is located at:
in RCModal
in RCTView (at View.js:60)
in View
in WithTheme (created by AntmModal)
in AntmModal
in WithTheme (created by OperationContainer)
in OperationContainer
in RCTView (at View.js:60)
in View (created by PortalManager)
in PortalManager (created by Portal.Host)
in Portal.Host (created by Provider)
in ThemeProvider (created by Provider)
in LocaleProvider (created by Provider)
in Provider (at router.js:150)
in Router (created by Connect(Router))
in Connect(Router) (at index.js:18)
in Provider (at dva.js:17)
in Unknown (at renderApplication.js:33)
in RCTView (at View.js:60)
in View (at AppContainer.js:102)
in RCTView (at View.js:60)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:32)

请问你这个问题解决了吗。。我也遇到了

commented

3.1.5 版本怎么改变主题,要做一个夜间模式效果,谢谢大家

commented
* General
  
  * [x]  Upgrade react-native and other dependencies to the latest version
  * [x]  bug fixes
  * [x]  ~Improve the documentation (use expo to preview or provide Gif)~ CodeSandBox

* Refactoring
  
  * [x]  File naming (remove the native suffix)
  * [x]  More friendly theme support, user-friendly
  * [x]  Improve TypeScript type definitions
  * [x]  Split the components in `react-component` (previously shared with the Web)


* 常规
  
  * [x]  升级 react-native 以及其他依赖到最新版
  * [x]  bug修复
  * [x]  ~完善文档(看是否可以使用expo来预览,不然就只能提供Gif了)~ CodeSandBox

* 重构
  
  * [x]  文件命名(去掉native后缀)
  * [x]  更友好的主题支持,方便用户自定义
  * [x]  完善TypeScript 类型定义
  * [x]  拆分`react-component`里面的组件(之前是跟Web共用的)

现在的改变主题,怎么用的,我想要动态改变主题,做夜间模式,求大神指点