Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.

Support Functional Stateless Components #14

Closed
theKashey opened this issue Jan 16, 2018 · 3 comments
Closed

Support Functional Stateless Components #14

theKashey opened this issue Jan 16, 2018 · 3 comments

Comments

@theKashey
Copy link

Currently it just removes prop-types at all, and converts SFC into a simple function.

@mohsen1
Copy link
Contributor

mohsen1 commented Jan 16, 2018

Something I love to work on. I would gladly help you implement it if you want to get your hands dirty with TypeScript compiler APIs as well.

@theKashey
Copy link
Author

As long I really need it - might be I should be a right one to implement it.
Let me dive deeper into the current code to roughly get idea how it works, and then I'll ask you to help.

@vincentbel
Copy link
Contributor

vincentbel commented Jan 20, 2018

I have recently refactor my project to use TypeScript and I've do some work to improve the code base and add more transforms. including:

  • Update TypeScript to 2.6 Update TypeScript to 2.6 #16
  • Stateless Components Support stateless component #23
  • Support more PropTypes: Support more prop types #19
    • PropTypes.oneOf() // limited, only support string or number literal array oneOf(['a', 'b', 'c'])
    • PropTypes.oneOfType()
    • PropTypes.arrayOf()
    • // Maybe more
  • Remove import PropTypes from 'prop-types'
  • React import: import React, { Component } from 'react' => import * as React from 'react' // Can be dangerous, need more discussion.

I'd like to polish it up and send some pull requests to review & discuss.

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

No branches or pull requests

3 participants