Based on what I can understand you want to change the CSS class based on the scrollFirstDigit and scrollSecondDigit variables you've created (adding a scroll class to the list of classes). In React I often use the classnames modules to do things like this. For example the following maybe something you're interested in:

var classnames = require('classnames');
<div className={classnames({ 'number current': true, 'scroll': this.state.scrollFirstDigit === true})}>;

So you can simply toggle the CSS classes you want by altering the state object (since it will trigger a re-render and cause the revaluation of the classes). You can see more examples at the modules github page.

Related Query

More Query from same tag