In the past, parents were told not to give their babies allergy-provoking foods till they were older.
And as allergies tend to run in families, what some pregnant women did was to avoid consuming allergenic foods.
But there has been a shift in thinking in recent years.
Just last week, the Canadian Paediatric Society updated its food guidelines for babies at risk of allergies, saying that they should be offered common allergenic foods such as peanut butter and eggs at around six months old, but not before four months.
Babies are considered at high risk of developing food allergy if they have a personal history of atopy, such as eczema, or if they have a first-degree relative - such as a parent or sibling - with allergies, it said.
In the United States, guidelines issued in early 2017 called for parents to give their children foods containing peanuts early in order to prevent peanut allergies.
It said that babies can be given pureed food or finger food containing peanut powder or extract - but not whole peanuts or peanut bits - before they are six months old, and even earlier if a child is prone to allergies.
Dr Elizabeth Tham, a consultant at the division of paediatric allergy, immunology and rheumatology at National University Hospital, advises the same. The introduction of solid foods, including allergenic foods such as eggs, peanuts and shellfish, should commence between four and six months of age and should not be delayed beyond six months of age, she said.
"In fact, evidence suggests that delaying the introduction of foods, especially allergenic foods such as peanut and egg, may increase the risk of developing food allergies," she said.
Also, the daily application of emollients or moisturisers on babies' skin from birth may reduce the risk of developing eczema, which is a risk factor for the development of food allergies, she added.
She encourages all mothers to breastfeed for at least six months and, if possible, up to one year.
Mothers and their infants should consume a well-balanced diet, with high amounts of fruit, vegetables and omega-3 fish oils, she said.
"Pregnant mothers do not need to avoid any allergenic foods during pregnancy as there is no evidence that this reduces the risk of allergies in their children," she added.