Closed pakmans closed 7 years ago
Do you get error like this:
Error in ./~/react-toolbox/lib/button/theme.css
Module build failed: Error: composition is only allowed when selector is single :local class name not in ".raised", ".raised" is we
ird
at Array.map (native)
@ ./~/react-toolbox/lib/button/theme.css
Try to change import { Button } from 'react-toolbox/lib/button/Button'
with
import Button from 'react-toolbox/lib/button/Button'
The same here, but this solution don't work for Table
:
Try to change import { Button } from 'react-toolbox/lib/button/Button' with import Button from 'react-toolbox/lib/button/Button'
import React, { Component } from 'react';
import Table from 'react-toolbox/lib/table/Table';
import './App.css';
const UserModel = {
name: {type: String},
twitter: {type: String},
birthdate: {type: Date,
title: 'Date of Birth'},
cats: {type: Number},
dogs: {type: Number},
active: {type: Boolean}
};
const users = [
{name: 'Javi Jimenez', twitter: '@soyjavi', birthdate: new Date(1980, 3, 11), cats: 1},
{name: 'Javi Velasco', twitter: '@javivelasco', birthdate: new Date(1987, 1, 1), dogs: 1, active: true}
];
class App extends Component {
render() {
return (
<div className="App">
<Table
model={UserModel}
source={this.state.source}
/>
</div>
);
}
}
export default App;
Failed to compile.
Error in ./~/react-toolbox/lib/checkbox/Checkbox.js
Module not found: 'react-style-proptype' in /home/rodrigo/myapp/node_modules/react-toolbox/lib/checkbox
@ ./~/react-toolbox/lib/checkbox/Checkbox.js 20:26-57
There was no error in the terminal nor in the web console. Changing the import from { Button } to Button worked. Thank you very much, damn default imports! I need to understand more how imports work. Sorry for posting here, I should have posted elsewhere (stackoverflow perhaps).
I am newbie, too. I don't really understand what happen there. I think it is because most of the example still written in 1.x.x version. The 2.0.0-beta.x have different method in importing.
If you want to import with css use index files otherwise you have to import the component file. These two way exist because we need to allow people to import a component raw but also it's convenient to import with styles. It's going to change soon because it's a bit messy anyway!
The button shows, but with no styling at all. When I click, an animation does occur (at a different position than the button).
I'm new to React + node so there is not much input I can give other than my files. I followed both the readme and animated gif, making adjustments here and there because of differences in path names and locations (probably due to differences in create-react-app version?)
File structure (omitting node_modules):
I don't know how I ended with assets/react-toolbox/ and src/toolbox/. I have tried both without success.
package.json
index.js
App.js