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.

Add support for React 16

See original GitHub issue

I think it would be great if this plugin would be ready with supporting all the new things that React 16 has to offer.

Currently I’m not sure exactly what would need to to be added though. The only thing I could think of was the componentDidCatch “lifecycle method” that got added. This should be added to a number of rules (prop-types, no-unused-prop-types, no-typos) and should only be checked when using React 16.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

10reactions
jseminckcommented, Sep 27, 2017

Another thing we should test: since it’s now possible to return an array from render(), but the array does require keys at the moment. So we should check whether the current rule react/no-array-index-key: Prevent using Array index in key props works for this case…

render() {
  // No need to wrap list items in an extra element!
  return [
    // Don't forget the keys :)
    <li key="A">First item</li>,
    <li key="B">Second item</li>,
    <li key="C">Third item</li>,
  ];
}

Edit: it works already. The rule was already smart enough to detect arrays!

9reactions
amannncommented, Nov 17, 2017

Another one I just stumbled across: react/sort-comp should recognize componentDidCatch as a lifecycle method in the order property.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React v16.0 – React Blog
Starting with React 16.2.0, we are adding support for a special fragment syntax to JSX that doesn't require keys. We've added support for ......
Read more >
React 16 - Mobify DevCenter
Part 1: Upgrade your project to support React 15.6 ... On the React blog post it mentions that if your app runs 15.6...
Read more >
Add React 16 Support · Issue #199 - GitHub
Feature Request react-transition-group provides support for react v^15.0.0. React 16 is expected to be released soon and can currently be ...
Read more >
enzyme-adapter-react-16 | Yarn - Package Manager
Enzyme is a JavaScript Testing utility for React that makes it easier to test your React Components' output. You can also manipulate, traverse, ......
Read more >
How to downgrade React version 17 to 16? - Stack Overflow
Search for the react and react-dom packages under dependencies (or devDependencies ) and replace their versions with 16.13.0 . Then run npm install...
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