Implements table of contents in React