I have an data object in a state, like so:
this.state = {
        data: {
            newsData: [],
            eventData: [],
        },
    }
How can I get the number of properties defined in the state data? data.length doesn't work since it's not an array.
 
    