Comments (3)
Contrary to your description, both mantra g component core:messages
and mantra g container core:messages
will generate a component looking like the following:
import React from 'react';
const Messages = () => (
<div>
Messages
</div>
);
export default Messages;
To generate the component of the first form in your question, you need to use --use-class
option. See README.
The distinction between the two types of components is whether they have states or not. The first may have states while the latter cannot. Avoiding the first when you can is considered a good practice. You can read more here.
from mantra-cli.
Please re-open if there is an issue. A good place to discuss Mantra related topics is https://talk.mantrajs.com/.
from mantra-cli.
Snap. You're right. My bad on that.
Appreciate the link I'll check that out.
from mantra-cli.
Related Issues (20)
- How do we generate stories now ? HOT 1
- mantra c -s 'error: unknown option `-s'' HOT 1
- Change default component extension HOT 2
- source map HOT 1
- Failed creating a mantra app HOT 4
- [new feature] Add option to choose react-router HOT 1
- [Feature] make tests optional HOT 1
- [Code style] container generator should use component generator
- skip creation of routes HOT 4
- BUG: imports of stories in .stories/index.js are not removed when component is destroyed
- Customizing HOT 10
- [Feature] customize module-folder HOT 2
- Why the Mantra CLI generator says "Welcome to Mantra 0.4.2." ? HOT 2
- Change the tests path if the modules folder is customized
- Use the new storybooks/react package when generating a new project HOT 4
- Feature Request: rename HOT 4
- CLI deleted all my modules! HOT 3
- Generating publications/methods and collections issue HOT 3
- Install error with V0.4.0 : Cannot find module '../utils' HOT 5
- Cannot install mantra-cli 0.4.1. It gives a babel: not found error HOT 3
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 mantra-cli.