Skip to content
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

I'm Using On Windows 10 But Example Fails #29

Open
doverradio opened this issue Jun 4, 2020 · 0 comments
Open

I'm Using On Windows 10 But Example Fails #29

doverradio opened this issue Jun 4, 2020 · 0 comments

Comments

@doverradio
Copy link

Hello, I am trying to use your library but so far I got only errors. Perhaps you can let me know where I am wrong. My code:

import React, { Component } from 'react';
import SortableTree from 'react-sortable-tree';
import FileExplorerTheme from 'react-sortable-tree-theme-file-explorer';
 
export default class Tree extends Component {
  constructor(props) {
    super(props);
 
    this.state = {
      treeData: [{ title: '.', children: [{ title: 'index.js' }] }],
    };
  }
 
  render() {
    return (
      <div style={{ height: 400 }}>
        <SortableTree
          treeData={this.state.treeData}
          onChange={treeData => this.setState({ treeData })}
          theme={FileExplorerTheme}
        />
      </div>
    );
  }
}

Instead of './src/ I made it '.' since there is no './src'. However, I intend to use this to display a specific folder on the Windows PC so please let me know what to do. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant