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.

Differences to React: default state shape

See original GitHub issue
class App extends Component {
  render() {
    console.log(this.state) // react: null | preact: {}
  }
}

Can PR if you want to mention it.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
gpoitchcommented, Jul 8, 2019
1reaction
marvinhagemeistercommented, Jul 8, 2019

We had null for a while in X but changed it back to an empty object for size reasons 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choosing the State Structure - React Docs
When you write a component that holds some state, you'll have to make choices about how many state variables to use and what...
Read more >
Comparison of state management solutions for React - Medium
I also wanted to provide an initial state to each state management library so that i have got the possibility to write integration...
Read more >
React State vs Props: Understanding the Difference
Understanding the differences: React State vs Props ; Initial Value Requirement, Passed from parent component, can be empty, Needs an initial ...
Read more >
Here's how to optimize the state shape of your React app with ...
Initial state shape approach · Replace arrays by objects · Including comments for each tweet · Putting it all together · Selectors.
Read more >
How can I specify the shape of the state in a React/Redux ...
Perhaps because English is not my mother tongue, I'm not aware of that subtle difference. – eddy. Jun 28, 2017 at 16:08. Add...
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