Stable sort implementation in JSX