The invention belongs to the field of organic electroluminescent materials, and discloses a heterocyclic compound and use thereof. The heterocyclic compound provided by the invention has a structure of a formula (B) and has the advantages of serving as a blue-light or dark-blue-light luminescent material for an organic electroluminescent device and overcoming the defects of an existing blue-lightluminescent material; and the compound, as a luminescent material, has a closely matched hole-electron transmission rate, which is conducive to improving the luminescence efficiency of the material and device stability. In addition, the compound has extremely high bond dissociation energy, which is conducive to prolonging the driving life of a display device. Moreover, the compound has an extremely high radiative transition rate constant, which is conducive to prolonging the driving life of an organic light-emitting diode device.