question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove Factory Components

See original GitHub issue

We support a very unusual kind of components that look like functional components but return an instance.

function Hello(props) {
  return {
    componentDidMount() {
      alert('wow')
    }
    render() {
      return <div>Hi, {this.props.name}</div>
    }
  };
}

Note these are not functional components. They’re pretty exotic and don’t offer any practical benefits over classes. At the time they were added (I think 0.14?) it was because we thought other type systems might want to compile to a format like this instead of ES classes-like output. But that didn’t happen.

There’s some complexity associated with continuing to support this. Since this is more confusing than useful, I think we should deprecate them in 16.x and remove in 17.x.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:60
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lustoykovcommented, Oct 20, 2018

Curious: Maybe some warning is needed for SSR too, in case a different renderer is utilized?

PS. Sorry for the pollution below, I’ve removed the issue id from the commit message so it doesn’t affect future rebases.

0reactions
prichodkocommented, Sep 9, 2018

Last answer sounded unclear, so I would love to take this over. 😃

I suppose warning could be placed somewhere here - https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberBeginWork.js#L715?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Remove Factory Badges and Decals In Ten Easy Steps
Once the badge is removed, the factory double-sided adhesive will leave behind a heavy amount of residue. No worry, though, as your finger ......
Read more >
Remover - FACTORY I/O
Remover¶. Removes one or more Items from the scene (e.g. cardboard box, pallet, product lid) when they intersect the remover's volume.
Read more >
Step One: Removal Of Factory Parts - Track Dog Racing
Step 1 - Removal of Factory Parts · 1.1 Belly Pan Removal · 1.2 Radiator Removal · 1.3 A/C Condenser Coil Removal ·...
Read more >
typed factory facility - Remove components in Castle Windsor 3
I was unable to find how to remove a component (this should be added back in). The best way I could find to...
Read more >
Cold Component Removal-PCB Board Precision Milling
This video describes and demonstrates the cold component removal process. Underfilled or high density boards are in many cases very ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found