I saw a tiktok where a man claimed that shanties came from African slaves who would sing under the boards on the deck, and when I tried to look into this further I couldn’t find a single source to support it. That said, I couldn’t find anything to support where I thought they came from, Celtic chants. Can anyone help me out with this?
African influence played a significant role in the development of sea shanties -- but not, as far as I'm aware, from slaves singing under the decks.
Sea shanties primarily date to between the 1840s and 1880s, which is actually a really short time period. While some shanty singing continued in work contexts as late as the 1930s, by and large they had faded out of living oral tradition in the late 19th century. Folk song collectors in England noticed their brief heyday and started collecting them from sailors in the early 20th century. There was a lot of anxiety in Britain at the time about the decline of Britain's great maritime tradition, which was tied to its self-image as the imperial dominator of the seas. As technology changed, shanties fell out of use, so collecting them was part of this wider interest in British maritime history.
Although the sea shanty is sometimes portrayed as the quintissentially English work song, it had substantial origins in African, American, and Caribbean musical traditions. When British sailing ships came to the Caribbean in their long-distance shipping journeys, the workers interacted with Black port workers. These Black workers came from a strong background of rhythmic work song from working in cotton fields, pile-drivers, and sugar presses in the US and Caribbean. Early 20th century English collectors of shanties recognised that many of the songs were directly influenced by Black work songs, and there were plenty of Black men who became shantymen themselves. (Shantymen were the ones who had a reputation for leading shanties particularly well, and they could fetch a competitive salary as captains saw it in their best economic interest to recruit talented ones.) Some of the earliest and most important informants in early shanty collecting asserted the importance of Black influence on the music, such as Frank Bullen, who argued that "the majority of shanties were negroid in origin".
After the 1920s, though, white English folklorists began to reject this idea as they considered Black influence something that would "taint" what they were increasingly coming to construct as a pure English (read: white) musical tradition. This fit with a wider trend of anxieties in England about the influence of Black American musical genres like ragtime and jazz. The way they write about the idea of Black influence on shanties in this period is full of racism. For example, Cicely Fox Smith accused Frank Bullen of having "[N-word] on the brain" and couldn't tolerate the idea that "the whole great mercantile marine of England learned to sing out on a rope from a gang of [N-words] in Antigua".
Another important source of musical influence for sea shanties was American river workers. These workers were often Black or Irish, and some coming from as far as Canada were French (though Louisiana also had its own French population too). Every year as part of seasonal workers' migrations, seafarers and riverworkers would come together in the Gulf of Mexico ports, and musical exchange was rampant among them. As Graeme J. Milne writes, "Such patterns created an annual remixing of musical influences from roots in Irish, African, Scots, French and new American urban cultures."
Sailing work songs also existed in other European cultures. Norwegian, Greek, Dutch, and Russian crews were still singing shanties in the 1890s. This was viewed with hostility by some English commentators, who felt that the English sailing tradition was being threatened by foreigners -- and its music with it. One author at the time said, "It is absurd to suppose that Dutchmen or Dagos, who chiefly man our sailing ships now, can in any way truly appreciate our ancient, wild hooraw choruses". Note here the idea that shanties are "our ancient" music, when in reality, as stated earlier, the vast majority of shanties date to the 1840s at earliest. The European sailors, furthermore, were not trying to invade some sacrosanct British tradition, but were simply taking up the jobs on sailing ships as British sailors largely moved to steam.
It's worth noting that many of the shantymen themselves did not share this xenophobic idea of what their songs represented. In the 1850s, for example, many British sailors were hostile to the idea of fighting for Britain against America if they went to war again. Some of the shanties, such as "Boney was a warrior", record class resentments against the British aristocracy. And of course, above all, shanties were a constantly changing musical form. The words were constantly improvised to name different ports and people. The sailors who sang them were far from precious about preserving any "pure" form of them, but were instead constantly remixing them to suit their circumstances. As Milne says, there is an "irony of how one of the world's most cosmopolitan musical forms was appropriated as a symbol of British maritime pride".
See Graeme J. Milne, "Collecting the sea shanty: British maritime identity and Atlantic musical cultures in the early twentieth century", The International Journal of Maritime History 29(2) (2017) [link].