Let $G$ be an abelian group and $G=\oplus_\alpha G_\alpha$. For each $\alpha$, let $H_\alpha$ be a subgroup of $G_\alpha$. Let $H=\oplus_\alpha H_\alpha$. For each $\alpha$, let $q_\alpha:G_\alpha\to G_\alpha/H_\alpha$ be the quotient map. We get a map $\oplus_\alpha q_\alpha:\oplus_\alpha G_\alpha\to \oplus_\alpha G_\alpha/H_\alpha$. The map $\oplus_\alpha q_\alpha$ is onto and it's kernel is $H$. So we get that $G/H\simeq \oplus_\alpha G_\alpha/H_\alpha$.
We will now state a general result. Given an arbitrary collection of chain complexes of abelian groups $\{(A^\alpha_\bullet,\partial_\bullet^\alpha):\alpha\in\Lambda\}$ we can form the chain complex $(A_\bullet,\partial_\bullet)$ where for each $n\in\mathbb Z$, we define $A_n=\oplus_\alpha A^\alpha_n$ and $\partial_n=\oplus_\alpha \partial^\alpha_n$. We can check that the homology groups of this complex $H_n(A_\bullet)\simeq \oplus_\alpha H_n(A^\alpha_\bullet)$.
Suppose $\{X_\alpha:\alpha\in\Lambda\}$ are the path-components of a space $X$. For each $n\in\mathbb N$, let $C_n(X)$ be the group of singular $n$-chains in $X$. Let $\Delta^n$ denote the standard $n$-simplex and let $\sigma:\Delta^n\to X$ be a singular $n$-simplex. As $\Delta^n$ is path-connected, so is the image of $\sigma$ and hence it is contained in some path-component of $X$. As any singular $n$-chain is a finite formal $\mathbb Z$-linear combination of singular $n$-simplices, it follows that $C_n(X)=\oplus_\alpha C_n(X_\alpha)$.
From the definition of the boundary map $\partial_n:C_n(X)\to C_{n-1}(X)$ and the boundary maps $\partial_n^\alpha:C_n(X_\alpha)\to C_{n-1}(X_\alpha)$, it follows that $\partial_n^\alpha$ is obtained by the restriction of the map $\partial_n$ to $C_n(X_\alpha)$ for each $\alpha\in\Lambda$. Thus, we get that $\partial_n=\oplus_\alpha \partial_n^\alpha$. Hence, from the above mentioned general result, we see that $H_n(X)=\oplus_\alpha H_n(X_\alpha)$.