Skip to content

[Bug] Collapse manually import not work in "@ant-design/react-native": "^5.4.1", #1429

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

Open
1 task done
htphuocdl opened this issue May 19, 2025 · 1 comment
Open
1 task done
Labels

Comments

@htphuocdl
Copy link

💬 Before You Start

  • I have searched the issues of this repository and believe that this is not a duplicate.

🙋 Description/Step to reproduce

import Collapse from '@ant-design/react-native/lib/collapse';

const App = () => {
  return <Collapse accordion></Collapse>
}

🔴 Version

5.4.1

💻 Environment

Android

⚫️ Output of npx react-native info

npx react-native info
warn Package @ant-design/icons-react-native contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
  OS: Linux 6.11 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
  CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400F
  Memory: 11.22 GB / 31.18 GB
  Shell:
    version: 5.2.21
    path: /bin/bash
Binaries:
  Node:
    version: 22.11.0
    path: ~/.nvm/versions/node/v22.11.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v22.11.0/bin/yarn
  npm:
    version: 10.9.0
    path: ~/.nvm/versions/node/v22.11.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 34.0.0
      - 35.0.0
      - 35.0.1
      - 36.0.0
    System Images:
      - android-34 | Google APIs Intel x86_64 Atom
      - android-36 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: AI-243.24978.46.2431.13208083
Languages:
  Java:
    version: 17.0.15
    path: /usr/lib/jvm/java-17-openjdk-amd64/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.79.2 is now available (your project is running on v0.76.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.79.2
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.6&to=0.79.2
info For more info, check out "https://reactnative.dev/docs/upgrading?os=linux".

Additional comments

No response

@aroldo-cittati
Copy link
Contributor

aroldo-cittati commented May 19, 2025

Hello @htphuocdl,

I saw your issue and I want to ask a few questions to try to help you:

Import vs. Rendering Issue:

Is the problem when you try to import the Collapse component, or does it import fine but nothing shows on the screen?

Usage of Collapse.Panel:

If nothing shows on the screen, did you try using a Collapse.Panel inside the Collapse? Like this:

<Collapse
  accordion
  arrow={(active) => (active ? <Icon name="minus" /> : <Icon name="plus" />)}
>
  <Collapse.Panel key="1" title="Text Here">
    Text Here
  </Collapse.Panel>
</Collapse>

Thanks a lot!

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

2 participants