GithubHelp home page GithubHelp logo

react-artisan's People

Contributors

dmtrxw avatar ryanarmial avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-artisan's Issues

[FEATURE IDEA] Add options for class static property

Hi @ryanarmial,

I would like to propose a feature, where the users will have the options to use static property inside of their class component.

So, the user can choose to generate the ordinary class component like what we have right now:

import React,  {  Component  } from 'react';

class About extends Component {
  constructor(props) {
    super(props);
    this.state = {  };

    this.exampleMethod = this.exampleMethod.bind(this) //if you dont want to use arrow function
  }

  componentDidMount() {
    //will run after component rendered
  }

  //you can use arrow function if you want bind function
  exampleMethod() {

  }
  
  render() {
    return (
      //Component Start Here
    );
  }
}

export default About;

or they can generate a class component which use the static property that will looks like this

import React, { Component } from 'react';

class About extends Component {
  state = {
    // your local states
  }

  componentDidMount() {
    //will run after component rendered
  }

  //you can use arrow function if you want bind function
  exampleMethod = () => {

  }
  
  render() {
    return (
      //Component Start Here
    );
  }
}

export default About;

That's what I have in my mind about a feature that we can add to this tool. Please tell me what you think about it.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.