Comments (9)
Yeah, a GitHub project would be ideal. I can have a look at this tomorrow.
from react-component-boilerplate.
Perfect!
I just pushed everything on github, here's the link.
from react-component-boilerplate.
Well I think I found out why, I'm trying to require my component in the src/index.js
and it doesn't like that. What I want to do eventually is to push this component on NPM to be used within other projects. Any quick ideas on how to do that?
from react-component-boilerplate.
Would var Component = require('../Component');
kind of import work? The current expects to find the file from the same directory. Just a quick guess.
Alternatively you could try to develop it below src/
directly (or rename?). I'm not entirely sure what splitting it up between src
and component
achieves.
from react-component-boilerplate.
I was working with the same structure that you have, with demo and src. I'll try that.
from react-component-boilerplate.
So yeah this is working, it runs npm run dist
without errors.
Another of my concerns is that I can't seem to be able to import css into Component.jsx
, the import only works in the component/index.js
file. Since I want to export the component has a complete standalone module I want it to work directly in the Component.jsx
.
Do you have an idea on how I should modify this to make it work?
from react-component-boilerplate.
CSS handling is somewhat problematic at the moment. There isn't single right way to handle it. Just see the Styling React chapter of my book to get some idea.
Bundling the style to dist
might be a little problematic as we cannot make any assumptions about how our packages are consumed. This is the reason why I like to include a sample CSS file to the project root. You can then import that through Webpack at least if nothing else.
Of course I'm willing to improve the setup if a better solution comes along. For now dealing with styling is a bit messy.
from react-component-boilerplate.
Ok perfect, thank you for your time this is really appreciated!
I will go css file at the project root because that seems to be the most logic way to go for now.
from react-component-boilerplate.
Alright, enjoy. 👍
from react-component-boilerplate.
Related Issues (20)
- Set up .npmignore
- Figure out how to deal with isomorphism in development mode
- `npm test` does not work for a fresh checkout HOT 3
- .npmignore problem HOT 1
- Adding a component to the Demo application HOT 11
- ES Lint Errors strict mode not permitted HOT 3
- Integrate nwb? HOT 1
- running the gh-pages npm command does nothing HOT 3
- Running 'npm install' on Windows throws an error
- Noticed a couple of issues while trying to use it HOT 7
- JSX -> JS dist-modules issue HOT 8
- You may need an appropriate loader to handle this file type HOT 13
- Serverside rendring compatibility HOT 9
- Error when running gh-pages
- Missing class properties transform. HOT 2
- Consider adding storybook HOT 4
- I get an error when running command BABEL_ENV=es6 HOT 2
- Error: spawn catalog.js-start ENOENT HOT 6
- Update Babel to 7.x HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-component-boilerplate.