Hannah’s dedication of Samuel is wrong

We all read in Scriptures about how Hannah made a vow and dedicated Samuel to the LORD at a very young age. While the Biblical authors narrate it in positive light, looking deeper into the law, scriptures and what Jesus taught, we can conclude Hannah was wrong to dedicate and leave young Samuel in the tabernacle.