Hooke's law is valid in a wide range of cases, not simply for classical springs. In many instances, the reacting force is directly proportional to the extension that causes it.