tree-select icon indicating copy to clipboard operation
tree-select copied to clipboard

Dropdown not rendering

Open dattakugve opened this issue 2 years ago • 5 comments

Hi TreeSelect is not rendering properly despite importing all the styles. Below is my code

import 'rc-tree-select/assets/index.less'; import TreeSelect from 'rc-tree-select';

function App() {

  const data = [{
    label: 'search me',
    value: 'searchme',

  }]
  return (

    <div>
      Tree select demo
      <TreeSelect treeData={data} style={{ width: '300px' }} placeholder="select" />
    </div>
  );
}

export default App;

Dropdown is not rendering correctly as can be seen from the attached screenshot. Am I missing something here or is it a bug. Please let me know 200365995-6586f7e6-b60f-42d7-86b3-57c6ef8cf549

dattakugve avatar Nov 09 '22 06:11 dattakugve

Do I need to install some compiler to compile .less files? Please let me know

dattakugve avatar Nov 10 '22 01:11 dattakugve

The same thing happens for me, not rendering!

mohamadmulhem avatar Nov 12 '22 23:11 mohamadmulhem

Internally it is loading the index.css but not rendering!

mohamadmulhem avatar Nov 12 '22 23:11 mohamadmulhem

I have same problem. I try the codesandbox and it won't rendered too. show like this image

roomay04 avatar Nov 28 '22 13:11 roomay04

I solve this issue, but my project is in NextJs 13 (without app folder).

Yes, we need a less compiler. This issue helped me #225

install next-with-less as a dependencie and import it on next.config.js

// next.config.js
const withLess = require("next-with-less");

/** @type {import('next').NextConfig} */
const nextConfig = {
  // ...your configs
}

module.exports = withLess(nextConfig);

on _app.tsx import rc-tree-select/assets/index.less

// _app.tsx
import "rc-tree-select/assets/index.less";
...

Hidekih avatar Sep 19 '23 13:09 Hidekih