Suppliers of Apple  (AAPL - Get Report)  components such as  Texas Instruments  (TXN - Get Report)  have become increasingly attractive investment opportunities as they diversify their businesses beyond just Apple.

"Texas Instruments is a way to play Apple because they have four different components in the iPhone," said Jim Cramer, TheStreet's founder and manager of the Action Alerts PLUS portfolio. "But what they distinguished last night in the conference call -- and it was a very good quarter -- was that they are an Internet of Things and industrial play."

The analog chip company reported first quarter revenue and profits ahead of analysts' expectations. Texas Instruments earned 65 cents per share on revenues of $3.01 billion, a 5% drop year-over-year. Analysts had been expecting $2.98 billion in revenues and earnings of 62 cents per share.

Second-quarter guidance was in line with analysts' consensus estimates. The company expects revenues in the quarter of between $3.07 billion and $3.33 billion and EPS between 67 cents and 77 cents, while analysts expected revenues of $3.18 billion and EPS of 71 cents per share.

Texas Instruments shares were up about 1% in afternoon trading Thursday.

Another Apple supplier is NXP Semiconductors (NXPI - Get Report) . NXP also reported strong earnings this week, with revenues in line with expectations and the bottom line exceeding expectations.

NXP, which is listed on the Nasdaq and headquartered in the Netherlands, earned $1.14 per share on revenues of $2.22 billion, a 52% increase year-over-year. Analysts had been looking for $1.11 in EPS and $2.2 billion in revenue. The second quarter guidance of $2.3 billion to $2.4 billion in revenue and EPS range of $1.30 to $1.40 were also in line with the consensus estimates of $2.33 billion and $1.32, respectively.

Matthew Ramsay, an analyst at Canaccord Genuity, wrote in a note that NXP "is fundamentally the best positioned mixed-signal semiconductor firm with attractive secular alignment with several industry growth drivers where security grows increasingly important."

Cramer said that Texas Instruments and NXP are both avoiding the Apple supplier trap.

"You have to be not captive to Apple, and the reason why is because one of the things that people are going to be saying is, unless Apple really bashes these suppliers and gets them to even give them better price concessions for the [iPhone] 7, they won't make as much money," he said. "So there's a war going on between these companies that supply Apple and Apple itself, and you want to be in the ones that aren't going to be hurt by collateral damage."