J.R. Smith was asked about LeBron James ditching the Cavs ... and went COMPLETELY NUCLEAR -- telling the guy who brought it up to get the "f*ck outta here!"

It all went down outside Poppy in L.A. -- one of the hottest new restaurants in West Hollywood -- when a photog hit a nerve by asking if LeBron was gonna leave Cleveland (again) after this season.

Smith, one of Bron's Cavs BFFs, wasn't havin' it -- ripping the dude (not our guy) to shreds ... before blowing up over a question on The King joining the Lakers, specifically.