'Wonder Years' Star Danica McKellar On Why She Breastfed Until Son Was 2 ½

American boys had a crush on Danica McKellar when she played Winnie Cooper on the 1980s hit show, "The Wonder Years."

McKellar is all grown up now and she's a mother with strong views on parenting. Some may deem those views unconventional.

McKellar is a proponent of attachment parenting, a style of child rearing that focuses on forming nurturing bonds through, among other things, extended breastfeeding, co-sleeping (allowing child to sleep in the same bed with parents), positive discipline and constantly being physically close to the child.

PHOTOS: Stars of 'The Wonder Years': Where Are They Now?

"I breastfed my child till he was two and a half," McKellar, 38, said in an interview with ABC News' Abbie Boudreau. "That was just, like, a few weeks ago that we stopped. Big transition."

McKellar said it was a bigger transition for her than for her son, Draco.

"I just sensed that it was time that he needed to be a little more independent," she said.

McKellar is one of many Hollywood mothers who practice attachment parenting. Others include singer Alanis Morissette and "Blossom" actress Mayim Bialik.

Boudreau asked McKellar how people perceived her when she was breastfeeding her son.

RELATED: Alanis Morissette, Now a Mother, Dives Into 'Attachment Parenting' and Breastfeeding Controversy

She said she would "get looks sometimes, from some of the older patrons" in restaurants, but said she didn't let it get to her.

"I … bring him into the bed with me sometimes at night and we snuggle and go to sleep together which is, the cutest thing in the world. I love being close with him," she said.

She said and Draco are so close that they share their own language. Generally, when infants are hungry, they cry. Her older son would ask.

"So he would say, 'Nam nams?' Just because I remember seeing some kitten video and they'd put, like, 'Nam, nam, nam,' like it was a yummy thing the kitten was eating. It was so cute that I was like, 'I'm going to call it 'Nam nam,'" McKellar said.

McKellar, a bestselling author who writes math books for children, said she would take breaks from writing to breastfeed her baby.

RELATED: 'The Wonder Years' Star, Danica McKellar, Returns to Acting

"When he was young, I had it mastered where I - learned to type with one hand for a while … I like to say that the only type of formula I use is in a math book," she said, laughing.

Although critics warn that extreme attachment parenting can lead to behavioral problems, McKellar isn't worried.

"Cuddling, being close, you know, sleeping in the same bed sometimes, wearing him in a sling, long-term breastfeeding, all have to have this closeness. On the other hand, doing everything your child wants you to do right when they want you to do it is another thing. Spoiling them is completely different," she said.

MORE: Hollywood Star Talks About Co-Sleeping, Baby-Wearing and Unschooling

She encourages other mothers to follow their instincts and take cues from their child.

"You can breastfeed as long as it works for both you and your child, you know?" she said. "For me it was two and a half and for you it might be three and a half or three months or whatever it is that works."