JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://select2.github.io/dist/js/select2.full.js"></script>
<link rel="stylesheet" href="https://select2.github.io/dist/css/select2.min.css">
<select class="form-control theread_p_ip" name="thread_p[]" multiple="multiple" style="width: 100%">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
</select>

JavaScript

var ajaxOptions = {};
ajaxOptions.data = {};
$(function(){
	$(".theread_p_ip").select2();
  
  $(".theread_p_ip").change(function(){
  	ajaxOptions.data.mySelect2 = $(this).val();
    console.log(ajaxOptions);
  });
});