ace python mode how to implement custom object properties and methods autocomplete and association

For example, if I import a test and the test has different properties and methods, I want to prompt for the properties and methods on the test when I execute the test.and continue to enter characters to prompt for the properties and methods on the test after the prompt pops up. Filter the display.

import test
test.a
test.b

The function I want to achieve is as described above, my idea is to click . I want to get the current object that I want to get the properties and methods of, read a json file through this object to get its properties and methods, and then add a custom completer, and at the same time add a custom object in . I’m not quite sure how to do it.

jquery datatable with CRUD operations

I am trying to work on datatables which will implement a working grid with all CRUD requirements.

Here is the grid –

    $("listTable").DataTable({
           "serverSide": true,
           "ajax":  {
                  "url" : "API URL",
                  "method" : "POST",
                  "data" : ""
                },
            "searching" : false,
            "info" : false,
            "scrollY" : false,
            "scrollX" : false,
            "lengthChange": false,
            "pageLength" : 5,
            "columns": [
                 {title: "ID", data: 'id' },
                 {title: "idValue", data: 'idValue' },
                 {title: "id option", data: 'idOption' },
                 {data: null , title: Action, wrap: true, render: function(item) { return '<a href="Edit">Edit</a>';} }
   ]
});

With the above code i can get a Read Only data in grid with output coming from API but how can i make it with add/update and delete rows.
Add will display a small dialog box with html inputs and have a submit/cancel button. On submission it should show the data in datattable along with datatabase as well.
Similar for edit. Delete would happen on the row which is selected and deleted.

Please suggest if there is any working examples too.

How to check if input field is large enough to display full content?

I’m using a Vuetify text-field component inside a table with many columns. It is possible that this component contains too much content to be displayed and from a UX perspective it takes too much time to check the content by scrolling inside the field if there are many cells.

Plain HTML example

Vuetify example

My first idea ( please let me know if you know better ones ) was to display a tooltip showing the full content but this would be annoying if the component is able to display the full content. So I only want to display the tooltip if content would be hidden/cut off.

So is there a way to get to know if the component is displaying the full content or if something is hidden/cut off? ( Table performance is important so I don’t know if very complex calculations on value changes are worth it )

I tried

( Playground )

<script setup>
  import { ref, watch } from 'vue'

  const field = ref()
  const msg = ref(
    'Hello World! too much content in this text field component to display.'
  )
  const isCuttingOff = ref(false)

  watch(
    msg,
    () => {
      const inputWidth = field.value?.clientWidth
      const inputValueWidth = msg.value.length // !!! measure the input value here !!!

      console.log({ inputWidth, inputValueWidth })

      isCuttingOff.value = inputWidth < inputValueWidth
    },
    { immediate: true }
  )
</script>

<template>
  <v-app>
    <div class="text-h3">Is cutting off: {{ isCuttingOff }}</div>
    <v-container class="w-25">
      <v-text-field ref="field" label="fsfdsf" v-model="msg" />
    </v-container>
  </v-app>
</template>

but

  • on startup, the variable inputWidth is undefined
  • I don’t know how to calculate the variable inputValueWidth

Using defaultHandleClick of react-chartjs-2

So I’m using react-chartjs-2 in my Functional Component. I’m using a Line chart

return <Line height='600px' options={options} data={data} />

And I want to do some custom to the defaultLegendClickHandler and I’m doing it like this:

import { defaults } from 'react-chartjs-2';

const defaultLegendFunction = defaults.global.legend.onClick;

const options = {
      legend: {
         display: true,
         onClick: function(event, legendItem) {
            defaultLegendFunction(event, legendItem);
            //My custom Function
         }
      },
   };

Then I got the error

caught TypeError: Cannot read properties of undefined (reading 'chart')

Which is because the ‘this’ is undefined in the default function of defaults react-chartjs-2 since every Chart Component is written in Class Component

core_defaults._set('global', {
    legend: {
        onClick: function(e, legendItem) {
            var index = legendItem.datasetIndex;
            var ci = this.chart; //'this' here is undefined
            var meta = ci.getDatasetMeta(index);

            // more default code from react-chartjs ...

How can I pass ‘this’ into this default function? Or is there any solution that I can add my custom function to that legendHandleClick without override the default function?

Getting TypeError: Cannot read properties of undefined (reading ‘map’) when i try to fetch data

I have a react frontend and when i try to get data from my node js backend but my api seems to be in order

const SingleProductPage = () => {

  const { productId } = useParams();

  const [product, setProduct] = useState({});

  useEffect(() => {
    const fetchProduct = async () => {
      const { data } = await axios.get(`/api/Product/${productId}`);
      setProduct(data);
    };
    fetchProduct();
  }, [productId]);

  if (!product) {
    return <Error errorMessage="Sorry, Product not found!" />;
  }


  return (
        <div className="single-slider-div">
          <Splide>
            {product.src.map((src, index) => (
              <SplideSlide>
                <img key={index} src={src} alt="product img" />
              </SplideSlide>
            ))}
          </Splide>
        </div>
      
  );
};

export default SingleProductPage;

I tried setting an object as the initial state for product but it returns the same error, i tried testing the backend route and it works fine. I have added relevant parts of the code.

Link Payment Stripe With Register

I have a register page, and when someone fills out the form and clicks submit, he will save his data in MongoDB, generate a token, set payStatus to false automatically, and redirect me to the payment page of the Stripe API. Everything works.

But when I want the user to pay in the payment page, I want to know who paid to set his pay status in MongoDB to true. I don’t know how I can do it, and please, if there is another good logic to refuse any login without registering and paying, answer me.

How to make my google sheet appear in my website with constant updates lively?

So, while I was building my website, I faced a problem which it shows up in the website but it’s not constantly updating whenever I make some changes. Sure it does change for like the first time changing the google sheet, but it takes for a while(around 7~20 minutes) to display another change.

HTML:

<!DOCTYPE html>
<html> 
<head> 
<link rel="stylesheet" href="style.css">
<title> Track Service Hours </title>
<link rel="icon" href="Logo.jpeg" type="image/x-icon"/>
</head>
<body> 
    <p2><a href="Website.html">Go Back</a></p2>
    <!-- <script src="Refresh.js">
        Test
    </script> -->
  <iframe src="spreadsheetIDlink_was_heregid=0&amp;single=true&amp;widget=true&amp;headers=false"></iframe>
</body>
</html>

There was a identical problem that’s similar to mine. So, I tried to put window.setTime but it didn’t work.

JS:
window.setTimeout(1000);

Is there anyway to make it “live” with constant updates?

Like I stated, I tried to search online and found a similar problem but didn’t seem to work. Plus, I wanted to make it live, which also didn’t work out well either.

Three.js + Fabric.js raycast works with mouse but not touch events on mobile device

I’ve been trying to solve the problem for several days, but so far all in vain. I am hope for your help.

Based on https://codepen.io/naonvl/pen/ExbjejL

Code below:

/**
* Fabric.js patch
*/
fabric.Canvas.prototype.getPointer =  function (e, ignoreZoom) {
  if (this._absolutePointer && !ignoreZoom) {
    return this._absolutePointer;
  }
  if (this._pointer && ignoreZoom) {
    return this._pointer;
  }
var simEvt;
        if (e.touches != undefined) {
            simEvt = new MouseEvent({
                touchstart: "mousedown",
                touchmove: "mousemove",
                touchend: "mouseup"
            }[e.type], {
                bubbles: true,
                cancelable: true,
                view: window,
                detail: 1,
                screenX: Math.round(e.changedTouches[0].screenX),
                screenY: Math.round(e.changedTouches[0].screenY),
                clientX: Math.round(e.changedTouches[0].clientX),
                clientY: Math.round(e.changedTouches[0].clientY),
                ctrlKey: false,
                altKey: false,
                shiftKey: false,
                metaKey: false,
                button: 0,
                relatedTarget: null
            });
            var pointer = fabric.util.getPointer(simEvt),
                upperCanvasEl = this.upperCanvasEl,
                bounds = upperCanvasEl.getBoundingClientRect(),
                boundsWidth = bounds.width || 0,
                boundsHeight = bounds.height || 0,
                cssScale;
        } else {
            var pointer = fabric.util.getPointer(e),
                upperCanvasEl = this.upperCanvasEl,
                bounds = upperCanvasEl.getBoundingClientRect(),
                boundsWidth = bounds.width || 0,
                boundsHeight = bounds.height || 0,
                cssScale;
        }
  if (!boundsWidth || !boundsHeight ) {
    if ('top' in bounds && 'bottom' in bounds) {
      boundsHeight = Math.abs( bounds.top - bounds.bottom );
    }
    if ('right' in bounds && 'left' in bounds) {
      boundsWidth = Math.abs( bounds.right - bounds.left );
    }
  }
  this.calcOffset();
  pointer.x = pointer.x - this._offset.left;
  pointer.y = pointer.y - this._offset.top;
  /* BEGIN PATCH CODE */
 if (e.target !== this.upperCanvasEl) {
            var positionOnScene;
            if (isMobile == true) {
                positionOnScene = getPositionOnSceneTouch(container, e);
                if (positionOnScene) {
                    console.log(positionOnScene);
                    pointer.x = positionOnScene.x;
                    pointer.y = positionOnScene.y;
                }
            } else {
                positionOnScene = getPositionOnScene(container, e);
                if (positionOnScene) {
                    console.log(positionOnScene);
                    pointer.x = positionOnScene.x;
                    pointer.y = positionOnScene.y;
                }
            }
        }
  /* END PATCH CODE */
  if (!ignoreZoom) {
    pointer = this.restorePointerVpt(pointer);
  }

  if (boundsWidth === 0 || boundsHeight === 0) {
    cssScale = { width: 1, height: 1 };
  }
  else {
    cssScale = {
      width: upperCanvasEl.width / boundsWidth,
      height: upperCanvasEl.height / boundsHeight
    };
  }

  return {
    x: pointer.x * cssScale.width,
    y: pointer.y * cssScale.height
  };
}
  
  /**
   * Listeners
   */
  
  container.addEventListener("mousedown", onMouseEvt, false);
  
if (
    /(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(
        navigator.userAgent,
    ) ||
    /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(
        navigator.userAgent.substr(0, 4),
    )
) {
    isMobile = true;
    container.addEventListener("touchstart", onTouch, false);
}
  /**
   * Event handler
   */
  
function onTouch(evt) {
    evt.preventDefault();
    const positionOnScene = getPositionOnSceneTouch(container, evt);
    if (positionOnScene) {
        const canvasRect = canvas._offset;
        const simEvt = new MouseEvent(evt.type, {
            clientX: canvasRect.left + positionOnScene.x,
            clientY: canvasRect.top + positionOnScene.y,
        });
        canvas.upperCanvasEl.dispatchEvent(simEvt);
    }
}

function getPositionOnSceneTouch(sceneContainer, evt) {
    var array = getMousePosition(sceneContainer, evt.changedTouches[0].clientX, evt.changedTouches[0].clientY);
    onClickPosition.fromArray(array);
  console.log(scene);
    var intersects = getIntersects(onClickPosition, scene.children);
    if (intersects.length > 0 && intersects[0].uv) {
        var uv = intersects[0].uv;
        intersects[0].object.material.map.transformUv(uv);
        var circle = new fabric.Circle({
            radius: 3,
            left: getRealPosition("x", uv.x),
            top: getRealPosition("y", uv.y),
            fill: "white",
        });
        // canvas.add(circle);
        getUv = uv;
        return {
            x: getRealPosition("x", uv.x),
            y: getRealPosition("y", uv.y),
        };
    }
    return null;
}
  function onMouseEvt(evt) {
    evt.preventDefault();
    const positionOnScene = getPositionOnScene(container, evt)
    if (positionOnScene) {
      const canvasRect = canvas._offset;
      const simEvt = new MouseEvent(evt.type, {
        clientX: canvasRect.left + positionOnScene.x,
        clientY: canvasRect.top + positionOnScene.y
      });

      console.log(simEvt);

      canvas.upperCanvasEl.dispatchEvent(simEvt);
    }
  }

  /**
   * Three.js Helper functions
   */
  function getPositionOnScene(sceneContainer, evt) {
  console.log(evt);
  console.log(scene);
    var array = getMousePosition(container, evt.clientX, evt.clientY);
    onClickPosition.fromArray(array);
    var intersects = getIntersects(onClickPosition, scene.children);
    if (intersects.length > 0 && intersects[0].uv) {
      var uv = intersects[0].uv;
      intersects[0].object.material.map.transformUv(uv);
      return {
        x: getRealPosition('x', uv.x),
        y: getRealPosition('y', uv.y)
      }
    }
    return null
  }
  
  function getRealPosition(axis, value) {
    let CORRECTION_VALUE = axis === "x" ? 4.5 : 5.5;
  
    return Math.round(value * 512) - CORRECTION_VALUE;
  }
  
  var getMousePosition = function(dom, x, y) {
    var rect = dom.getBoundingClientRect();
    return [(x - rect.left) / rect.width, (y - rect.top) / rect.height];
  };
  
  var getIntersects = function(point, objects) {
    mouse.set(point.x * 2 - 1, -(point.y * 2) + 1);
    raycaster.setFromCamera(mouse, camera);
    return raycaster.intersectObjects(objects);
  };

The code works on desktop but doesn’t work on mobile device. I’m trying to move a fabricjs canvas directly over a threejs model and move/scale the canvas from a 3d model. This works great on PC but not on mobile.
Touch events for some reason do not seem to be recognized.

On the PC, the object can be selected and modified, but on mobile – only select the object, but not move around the model.

Simple explain about programming

I need simply explain about programming because I’m a beginner, please help me to know what I should do for the first also which platform that I need for programming. I really want to learn about programming.

For now, I just read about programming on some web, but I don’t think I can understand by only read that way, for what I expected I want to be the one in the future who can do some work on programming.

React UseEffect Array Loop Terminating

Trying to view just 3 array items from an existing larger array. Currently using useState to and initialising the array using the first three items from the larger array, then every second getting the next three. This works until the last item is reached and then nothing is displayed. The if block to revert it back to the first three items never gets touched and I don’t understand why.

There are 21 items in the ‘parent’ array so at some point the final item in both arrays should be equal?

Code below

export default function Carosel() {
  let maxIndex = 2;

  const [currentTestimonials, setCurrentTestimonials] = useState([
    testimonials[maxIndex - 2],
    testimonials[maxIndex - 1],
    testimonials[maxIndex],
  ]);

  useEffect(() => {
    const interval = setInterval(() => {
      if (currentTestimonials[-1].localeCompare(currentTestimonials[-1]) == 0){
        console.log("HERE");
        maxIndex = 2;
      } else {
        console.log("ADD THREE");
        maxIndex += 3;
      }
      setCurrentTestimonials([
        testimonials[maxIndex - 2],
        testimonials[maxIndex - 1],
        testimonials[maxIndex]
      ]);
      console.log(currentTestimonials[0]);
    }, 1000);

    return () => clearInterval(interval);
  }, []);

  console.log(currentTestimonials);

  return (
    <div className="carosel-container flex">
      {currentTestimonials.map((testimonial) => (
        <div className="testimonial">
          <p>{testimonial}</p>
        </div>
      ))}
    </div>
  );
}

can i use three.js or library JavaScript to capture 2d image and converted to 3d obj face?

I’m having a problem designing a project where I can reverse a photo into a polycam or avaturn.me? I have a problem using TensorFlow.js and three.js to capture or upload 3 angels images of face and preview in 3d scenes of three.js. so what how can fix that?

TensorFlow.js
three.js

here you find html file :

<!DOCTYPE html>
<html>
<head>
    <title>Face Detection</title>
    <style>
        #output {
            position: relative;
        }
        canvas {
            position: absolute;
        }
    </style>
</head>
<body>
    <h1>Face Detection</h1>
    <input type="file" id="imageFile" accept="image/*" />
    <br /><br />
    <div id="output"></div>
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface"></script>
    <script src="index.js" type="module"></script>
</body>
</html>

JavaScript file index.js

import * as tf from 'https://cdn.skypack.dev/@tensorflow/tfjs';
import * as blazeface from 'https://cdn.skypack.dev/@tensorflow-models/blazeface';

// Global variables
let model, ctx;

async function run() {
    // Load the face detection model
    model = await blazeface.load();

    // Get the canvas and its context
    const canvas = document.createElement('canvas');
    ctx = canvas.getContext('2d');
    document.getElementById('output').appendChild(canvas);

    // Listen for file input changes
    document.getElementById('imageFile').addEventListener('change', handleFileSelect, false);
}

async function handleFileSelect(event) {
    // Clear previous detections
    ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);

    // Read the selected image file
    const file = event.target.files[0];
    const reader = new FileReader();

    reader.onload = async function (e) {
        const img = new Image();
        img.onload = async function () {
            // Resize the canvas to match the image size
            ctx.canvas.width = img.width;
            ctx.canvas.height = img.height;

            // Perform face detection
            const predictions = await model.estimateFaces(img);

            // Draw face bounding boxes on the canvas
            predictions.forEach(prediction => {
                const start = prediction.topLeft;
                const end = prediction.bottomRight;

                ctx.beginPath();
                ctx.lineWidth = 2;
                ctx.strokeStyle = 'red';
                ctx.rect(start[0], start[1], end[0] - start[0], end[1] - start[1]);
                ctx.stroke();
            });
        };

        img.src = e.target.result;
    };

    reader.readAsDataURL(file);
}

run();

Weird CSS local storage bug

Alright, on my portfolio webpage, I give the user an option to choose three different “skins” from a drop down menu in the navbar (None (default), Christmas, and Easter). This simply uses a script javascript to change the attribute in the style sheet tag. Here’s how it looks:

function skinCheck() {
    var skin = localStorage.getItem("skin");
    if (skin == null) {
        skin = "default";
    }
    $("link[type='text/css']").attr('href', "style/" + skin + '.css');
    $('select option[value="' + skin + '"]').attr("selected", true);
}


function setSkin() {
    console.log(event.target.value);

    localStorage.setItem("skin", event.target.value);

    skinCheck();
}

Now when a user switches skins, the local storage remembers this, so if you are “Easter” in one section, you are “Easter” in the next, and you will be “Easter” when you close out and come back.

Each stylesheet just changes some colors. The vast majority of the information between them is identical. This can make updating my style very tedious, because I have to update all three style sheets most of the time.

So, I had an idea. What if I put two stylesheets in my head tag? One on top with, and one below. The one below is what the script changes. So now my script looks like this:

function skinCheck() {
    var skin = localStorage.getItem("skin");
    if (skin == null) {
        skin = "default";
    }
    $(".subStyle").attr('href', "style/" + skin + '.css');
    $('select option[value="' + skin + '"]').attr("selected", true);
}


function setSkin() {
    console.log(event.target.value);

    localStorage.setItem("skin", event.target.value);

    skinCheck();
}

This works well enough, except now, the skin choice doesn’t seem to persist from page to page like it used to. Each section of my portfolio is remembered on its own. IE the “About Me” becomes Christmas and stays Christmas, but the Contact page will not change until I change it, or visa-versa.

What on Earth could be causing this?

EDIT:

Here’s an HTML snippet from the top of one of my pages, to give you a better idea how this works:

    <!DOCTYPE html>
<html lang ="en-us">
<head>
  <meta charset="UTF-8">
  <title>Downloads</title>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

   <link rel = "stylesheet" type="text/css" href="style/main.css">
  <link rel="stylesheet" class = "subStyle" type="text/css" href="style/default.css">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <script src="portfolio.js"></script>



 </head>

 <body onload="showStuff(), skinCheck()">

Trying to install React, facing massive blocker

/node_modules/react-scripts/node_modules/eslint-webpack-plugin/node_modules/jest-worker/build/index.js:110
_ending;
^

There’s gotta be some guide out there on the step to take to fix this, or some other specific folder to delete. I just don’t know what to do at this point.
just why

I have literally deleted, reinstalled npm, node, everything under the sun but this one error just keeps coming back.

Overlapping dropdown lists

I am using react-native-dropdown-picker to offer some options to my user.
Currently, i have two dropdowns in the same screen. The problem is that when i open the first dropdown, the list is getting covered by the second dropdown container.

I already did everything that is listed on the package website that is related to the positioning of the elements (using their zIndex and zIndexInverse properties) but i’m still struggling to get it to work.

Here are some pieces of code:

CustomDropdownComponent:

import { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import DropDownPicker from "react-native-dropdown-picker";
import { LightGray, PlaceholderGray } from '../../../assets/colors';

const styles = StyleSheet.create({
    placeholder: {
        fontSize: 15,
        color: PlaceholderGray
    },
    interFont: {
        fontFamily: "InterRegular"
    }
})

const Dropdown = ({ items, returnValue, placeholder, containerStyle, dropdownIndex, dropdownCount }) => {
    const [open, setOpen] = useState(false);
    const [value, setValue] = useState(false);

    const dropdownTheme = require("../../../assets/dropdownTheme");

    DropDownPicker.addTheme("DropdownTheme", dropdownTheme);
    DropDownPicker.setTheme("DropdownTheme");

    function selectValue(value) {
        setValue(value);
        returnValue(value);
    }

    console.log((dropdownCount - dropdownIndex) * 1000);
    console.log((dropdownIndex + 1) * 1000);
    return (
        <View style={containerStyle ?? {}}>
            <DropDownPicker
                zIndex={(dropdownCount - dropdownIndex) * 1000}
                zIndexInverse={(dropdownIndex + 1) * 1000}
                open={open}
                value={value}
                items={items}
                setOpen={setOpen}
                setValue={selectValue}
                placeholder={placeholder ?? "Selecione um item"}
                placeholderStyle={[styles.placeholder, styles.interFont]}
                listItemLabelStyle={styles.interFont}
                searchable={true}
            />
        </View>
    );
}

export default Dropdown;

The screen where i am using the CustomDropdown component:

import { View, Text, StyleSheet } from 'react-native';
import { useState } from 'react';
import PageTitle from '../components/textual/PageTitle';
import Section from '../components/layout/Section';
import Dropdown from '../components/inputs/Dropdown';
import Screen from '../components/layout/Screen';
import { dropdownize } from '../contrib';
import CustomSwitch from '../components/inputs/CustomSwitch';

const EndpointLayout = ({ endpointOptions, setEndpoint, endpointType, switchEndpointType, index, count }) => {
    const [open, setOpen] = useState(false);

    return (
        <View style={styles.endpoint}>
            <Dropdown
                dropdownIndex={index}
                dropdownCount={count}
                open={open}
                setOpen={setOpen}
                containerStyle={styles.endpointDropdown}
                items={dropdownize(endpointOptions[endpointType])}
                returnValue={setEndpoint}
                placeholder={"Selecione um local"}
            />
            <View style={styles.endpointType}>
                <Text style={styles.endpointTypeText}>{endpointType === "campus" ? "Campus" : "Bairro"}</Text>
                <CustomSwitch
                    switchValue={endpointType === "campus"}
                    onSwitchHandler={switchEndpointType}
                />
            </View>
        </View>
    );
}

const RegisterRouteScreen = ({ navigation }) => {
    const teste = {
        "campus": ["Campus1", "Campus2", "Campus3", "Campus4", "Campus5", "Campus6", "Campus7", "Campus8"],
        "neighborhood": ["Bairro1", "Bairro2", "Bairro3", "Bairro4", "Bairro5", "Bairro6", "Bairro7", "Bairro8"]
    };
    const [origin, setOrigin] = useState("");
    const [originType, setOriginType] = useState("campus");
    const [destiny, setDestiny] = useState("");
    const [destinyType, setDestinyType] = useState("campus");

    function getEndpointType(currentType) {
        return currentType === "campus" ? "neighborhood" : "campus";
    }

    return (
        <Screen>
            <PageTitle title={"Cadastrar Rota"} />
                <EndpointLayout
                    index={0}
                    count={2}
                    endpointOptions={teste}
                    setEndpoint={setOrigin}
                    endpointType={originType}
                    switchEndpointType={() => { setOriginType(getEndpointType(originType)) }}
                />
                <EndpointLayout
                    index={1}
                    count={2}
                    endpointOptions={teste}
                    setEndpoint={setDestiny}
                    endpointType={destinyType}
                    switchEndpointType={() => { setDestinyType(getEndpointType(destinyType)) }}
                />
        </Screen>
    );
}

const styles = StyleSheet.create({
    endpoint: {
        flexDirection: "row",
        justifyContent: "space-between",
        alignItems: "center"
    },
    endpointTypeSwitch: {
        marginLeft: 10
    },
    endpointDropdown: {
        width: "60%"
    },
    endpointType: {
        flexDirection: "row",
        alignItems: "center",
        alignSelf: "center"
    },
    endpointTypeText: {
        fontFamily: "InterRegular",
        marginRight: 5
    }
})

export default RegisterRouteScreen;

My Dropdown Custom theme (i copied from the light theme and just changed some colors and removed some borders):

import {
    Platform,
    StyleSheet
} from 'react-native';

import { LightGray, Black, White } from './colors';

export const ICONS = {
    ARROW_DOWN: require("../node_modules/react-native-dropdown-picker/src/themes/light/icons/arrow-down.png"),
    ARROW_UP: require('../node_modules/react-native-dropdown-picker/src/themes/light/icons/arrow-up.png'),
    TICK: require('../node_modules/react-native-dropdown-picker/src/themes/light/icons/tick.png'),
    CLOSE: require('../node_modules/react-native-dropdown-picker/src/themes/light/icons/close.png')
};

export default StyleSheet.create({
    container: {
        width: '100%',
    },
    style: {
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'space-between',
        width: '100%',
        minHeight: 50,
        borderRadius: 8,
        paddingHorizontal: 10,
        paddingVertical: 3,
        backgroundColor: LightGray
    },
    label: {
        flex: 1,
        color: Black
    },
    labelContainer: {
        flex: 1,
        flexDirection: 'row',
    },
    arrowIcon: {
        width: 20,
        height: 20
    },
    tickIcon: {
        width: 20,
        height: 20
    },
    closeIcon: {
        width: 30,
        height: 30
    },
    badgeStyle: {
        flexDirection: 'row',
        alignItems: 'center',
        borderRadius: 10,
        backgroundColor: LightGray,
        paddingHorizontal: 10,
        paddingVertical: 5
    },
    badgeDotStyle: {
        width: 10,
        height: 10,
        borderRadius: 10 / 2,
        marginRight: 8,
        backgroundColor: LightGray
    },
    badgeSeparator: {
        width: 5,
    },
    listBody: {
        height: '100%',
    },
    listBodyContainer: {
        flexGrow: 1,
        alignItems: 'center',
    },
    dropDownContainer: {
        position: 'absolute',
        backgroundColor: LightGray,
        borderRadius: 8,
        width: '100%',
        overflow: 'hidden',
        backgroundColor: "red",
        zIndex: 1000
    },
    modalContentContainer: {
        flexGrow: 1,
    },
    listItemContainer: {
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'space-between',
        paddingHorizontal: 10,
        height: 40
    },
    listItemLabel: {
        flex: 1,
        color: Black
    },
    iconContainer: {
        marginRight: 10
    },
    arrowIconContainer: {
        marginLeft: 10
    },
    tickIconContainer: {
        marginLeft: 10
    },
    closeIconContainer: {
        marginLeft: 10
    },
    listParentLabel: {

    },
    listChildLabel: {

    },
    listParentContainer: {

    },
    listChildContainer: {
        paddingLeft: 40,
    },
    searchContainer: {
        flexDirection: 'row',
        alignItems: 'center',
        padding: 10,
        borderColor: Black,
    },
    searchTextInput: {
        flexGrow: 1,
        flexShrink: 1,
        margin: 0,
        paddingHorizontal: 10,
        paddingVertical: 5,
        borderRadius: 8,
        color: Black
    },
    itemSeparator: {
        height: 1,
        backgroundColor: Black,
    },
    flatListContentContainer: {
        flexGrow: 1
    },
    customItemContainer: {

    },
    customItemLabel: {
        fontStyle: 'italic',
        fontFamily: "InterRegular"
    },
    listMessageContainer: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        padding: 10,
    },
    listMessageText: {

    },
    selectedItemContainer: {

    },
    selectedItemLabel: {

    },
    modalTitle: {
        fontFamily: "InterBold",
        fontSize: 18,
        color: Black
    },
    extendableBadgeContainer: {
        flexDirection: 'row',
        flexWrap: 'wrap',
        flex: 1
    },
    extendableBadgeItemContainer: {
        marginVertical: 3,
        marginEnd: 7
    }
});