How can I run a callback after Bootstrap initializes a plugin from data attributes?

I have a Bootstrap 4 radio button group. I want to make a state selection based on stored data at page load. If I do that in my script it runs before Bootstrap’s initialization of the toggle plugin. Then Bootstrap initializes its state and makes the first button active. This results in multiple buttons having the appearance of being selected.

$('#up').trigger('click');
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

<div class="btn-group btn-group-toggle w-100" data-toggle="buttons">
  <label class="btn btn-outline-secondary w-50 active" id="down">
    <input type="radio" name="direction" value="down" checked>Above
  </label>

  <label class="btn btn-outline-secondary w-50" id="up">
    <input type="radio" name="direction" value="up">Below
  </label>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

However, if I delay a while the selection happens cleanly.

setTimeout(function() {
  $('#up').trigger('click');
}, 200);
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

<div class="btn-group btn-group-toggle w-100" data-toggle="buttons">
  <label class="btn btn-outline-secondary w-50 active" id="down">
    <input type="radio" name="direction" value="down" checked>Above
  </label>

  <label class="btn btn-outline-secondary w-50" id="up">
    <input type="radio" name="direction" value="up">Below
  </label>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

It’s not a matter of using a zero-delay timeout to skip a cycle. That isn’t reliable. I have to use an arbitrarily long timeout to wait for Bootstrap. I’d much rather use a callback for better timing.

I haven’t been able to find anything regarding events for plugins initialized only with data attributes, nor have I found an all done event for Bootstrap as a whole. What are my options here?

How to add Tooltip on field Label in ruby on Rails form?

I’ve been trying to solve this problem but can’t come up with a good solution. Basically I have this field in my form:

<%= f.text_field :name, :label => "Name", :class => 'autofocus', disabled: (true if @special_string.eql?"name"), data: { "toggle"=> "tooltip",  "placement"=>"bottom", :title => "This is a tooltip text" } %>
  • As of right now my tooltip shows up right below my input field, but I want to show it when I hover over the Label Name, any ideas how to do that?

  • Also, how to only add this label if this condition is true:

    @special_string.eql?"name"
    

here’s a picture of what my tooltip looks like right now:

enter image description here

Google Cloud Function delete Firestore document

I tested my javascript on local emulator. There are 2 actions, if Timestamp is over 7 days delete the document (this is working like a charm <3) but the else is he should check the “img” its a normal url if this return 404 then delete like on the first action, this is ONLY working on local emulator, when i deploy it to Cloud function its not working anymore and just says e.g “Function execution took 7957 ms, finished with status: ‘ok'” BUT on local it works as expected.

exports.removeExpiredDocuments = functions.region('europe-west1').runWith({ memory: "256MB" }).pubsub.schedule("every 1 hours").onRun(async (context) => {
    const db = admin.firestore();
    const now = firestore.Timestamp.now();
    const ts = firestore.Timestamp.fromMillis(now.toMillis() - 604800000); // 168 hours in milliseconds = 604800000

    const snaps = await db.collection("products").get();
    let promises = [];
    snaps.forEach((snap) => {
        // functions.logger.info("forEachSnap");
        if (snap.data().created_time < ts) {
            promises.push(snap.ref.delete());
            functions.logger.info('[Time] older than 7 Days ' + snap.data().name, { structuredData: true });
        } else {
            requesth(snap.data().img, function (error, response) {
                functions.logger.info('[img] error: ' + error, { structuredData: true });
                if (response.statusCode == 404) {
                    promises.push(snap.ref.delete());
                    functions.logger.info('[img] not found ' + snap.data().name, { structuredData: true });
                }
            });
        }
    });

    return Promise.all(promises);
});

Working on local emulator (with same url as in firebase) and i expect that its working on cloud aswell

i am having issues with handling an async error in express

I am trying to handle an error when a post request is made to the campgrounds route without a body it should throw an error I have already defined my error signature to take care of the error thrown and it’s not working what could possibly be wrong with my program the post route expects a {price, location, and title} if a post is made on a black page without any information being posted the error should be thrown and it doesn’t seem to be executing.

The apperror is an error class I defined to handle my errors and the wrapasync is a wrapper function that enables me to handle my async errors without the need for the continuous repeating of the try-catch block

app.post('/campgrounds', wrapAsync(async (req, res) => {
if (!req.body) throw new AppError('Invalid Campground Data', 400);
newcamp = new Campground(req.body);
await newcamp.save();
res.redirect(`/campgrounds/${newcamp.id}`);

}));

if i run the program and submit it when i console.log the req.body this is what i get an object with { title: ”, location: ”, image: ”, price: ”, description: ‘ ‘ } no values and my error statement is not being thrown any help

How to pass a GeoJSON formatted array of longitude and latitude locations from php to javascript to create an Openlayers 6 map?

My php script successfully extracts data from a mysql database and creates a properly formatted and validated geojson array. But I can’t figure out how to pass that array directly to the javascript.

I am able to manually copy the GeoJSON data to a file called manually_copied.json and then call that from the javascript using ol.source.Vector url option. That creates a proper map with all my points but I want to go directly from php to the script without writing a file to disk.

I am novice at openlayers and javascript.

Here is most of my php script,

<!DOCTYPE html>
<html lang="en">
<head>

<link rel="stylesheet" href="lib/openlayers/v6.13.0/css/ol.css" type="text/css">
<script src="lib/openlayers/v6.13.0/build/ol.js"></script>

<style>
.map {
    height: 600px;
    width: 100%;
}
</style>
</head>
<body>
<?php

echo "n<div id="map" class="map"></div>";

//+++++

[ my code to extract a series of lon & lat values from an mysql database
[ to create an array called $geojson

//+++++

// unused
// echo json_encode($geojson, JSON_NUMERIC_CHECK);
?>

<script>

// How do I use this array??????
var geojson_from_php = <?php echo json_encode($geojson, JSON_NUMERIC_CHECK); ?>;
      
      var map = new ol.Map({
        layers: [
          new ol.layer.Tile({
            source: new ol.source.OSM()
          })
        ],
        target: 'map',
        view: new ol.View({
          center: ol.proj.transform([-98.45, 38.714], 'EPSG:4326', 'EPSG:3857'),
          zoom: 4
        })
      });
      var vector = new ol.layer.Vector({
            source: new ol.source.Vector({
            url: 'manually_copied.json',
            format: new ol.format.GeoJSON()
        }),
            style: new ol.style.Style({
            image: new ol.style.Icon({
            src: 'images/marker.png'
          })
         })
      });
      map.addLayer(vector);
</script>

Javascript algorithm exercise [closed]

Implement the algorithm to put in an array B, all the numbers that they are not present in a sorted array A starting from number 1.
Example : A = [3, 7, 8, 10] ( then B = [1,2,4,5,6,9]
Example : A = [10, 8, 7, 3] ( then B = [9, 6, 5, 4, 2, 1]

How do I ignore a Typescript error in a Javascript file (whilst I have `allowJs` set in my tsConfig)?

I have a handful of .js files in my Typescript project that looks something like this:

// do some things

return JSON.stringify(
  {
    ok: true,
    // blah blah blah
  },
  null,
  2
);

However, when I run tsc to type check my project, which has allowJs enabled, I receive this error:

error TS1108: A 'return' statement can only be used within a function body.
  return JSON.stringify(
  ~~~~~~

I’m confident in why I’m doing this (the code gets handed over to Snowflake) and would like to ignore this error.

Normally I would include a // @ts-expect-error directly above the offending return statement, however, this doesn’t work. Apparently, because it’s a javascript file, not a typescript file: if I change the file extension to .ts, the // @ts-expect-error comment behaves as expected and suppresses the error, however, it causes a bunch of other errors, as should be expected.

JavaScript function that takes a multidimensional array, flattens it, then returns array values as string in choice order

Having trouble with a certain objective where I have to create a function that takes a multidimensional array and returns a flat array with sentence string values using values from the given multidimensional array. I’m having a hard time iterating through the array and getting it to push the values to a new array. Everything I’ve tried returns the values in the wrong spots and now it just returns undefined. I’m so lost and frustrated

Define a function, zooInventory, that accepts a multi-dimensional array of animal facts.
zooInventory should return a new, flat array of strings. Each element in the new array should be a sentence about each of the animals in the zoo.

let myZoo = [
  ['King Kong', ['gorilla', 42]],
  ['Nemo', ['fish', 5]],
  ['Punxsutawney Phil', ['groundhog', 11]]
];

function zooInventory(zooList) {
  let zooFlat = [];
  let name = [];
  let animal = [];
  let age = [];
  for (let i = 0; i < zooList.length; i++) {
    if (!Array.isArray(zooList[i])) {
      name.push(zooList[i])
    } else {
      animal.push(zooList[i][0]);
      age.push(zooList[i][-1]);
    }
  }
  for (let j = 0; j < name.length; j++) {
    zooFlat.push(`${name[j]} the ${animal[j]} is ${age[j]}.`)
  }
  return zooFlat;
}
zooInventory(myZoo);
/* => ['King Kong the gorilla is 42.',
       'Nemo the fish is 5.'
       'Punxsutawney Phil the groundhog is 11.']
*/

sort array by specific attribute value and prioritize it to the top of array in JavaScript

I have an array of objects, and was trying to sort the array by prioritizing a specific id value and assigning it to the top of the array. The array is being returned via an API, and can be seen as the following data:

[
    {
        "id": 310,
        "title": "Breast Cancer Screening"
    },
    {
        "id": 315,
        "title": "Depression in Adults Screening"
    },
    {
        "id": 322,
        "title": "Aspirin Use to Prevent Cardiovascular Disease"
    },
    {
        "id": 329,
        "title": "Syphilis Infection in Nonpregnant Adults and Adolescents Screening"
    },
    {
        "id": 337,
        "title": "Latent Tuberculosis Infection Screening"
    }
]

So lets say in our case, we want to prioritize "id": 329 and want to move that to the top of the array resulting in the following:

[
    {
        "id": 329,
        "title": "Syphilis Infection in Nonpregnant Adults and Adolescents Screening"
    },
    {
        "id": 310,
        "title": "Breast Cancer Screening"
    },
    {
        "id": 315,
        "title": "Depression in Adults Screening"
    },
    {
        "id": 322,
        "title": "Aspirin Use to Prevent Cardiovascular Disease"
    },
    {
        "id": 337,
        "title": "Latent Tuberculosis Infection Screening"
    }
]

I was trying to implement the following function below to accomplish this sorting and filtering, but was having difficulties getting this to work. Any help or guidance on the right approach to accomplish this would be greatly appreciated!

sorting function

const prioritizeList = (recommendationsList) => {
        const prioritizedRecommendations = recommendationsList.specificRecommendations
        console.log("initialize prioritizedRecommendations", prioritizedRecommendations)

        const prioritizeArray  = [
            {"id":329}
        ];

        const arrayFiltered = prioritizedRecommendations.filter(item => prioritizeArray.find(i => i.id === item.id))

        let newArr = prioritizeArray.concat(arrayFiltered)
}

Supabase getUserByCookie not working on mobile

Trying to test my app on a mobile device, but it won’t get cookie from server-side requests. (works as expected on chrome)
when running getServerSideProps in Next.js I call:

export async function getServerSideProps({ req }) {
  const { user } = await supabase.auth.api.getUserByCookie(req)

  console.log('user from cookie', user)

  if (!user) {
    return { props: {}, redirect: { destination: '/sign-in' } }
  }
  const { data: teams } = await supabase
    .from('teams')
    .select('*')
    .eq('user_id', user.id)

  // do something with the user...
  return {
    props: {
      teams,
    },
  }
}

This returns a ‘user’ object when I run the app on Chrome or any other web browser, however, when I try on my mobile device, it fails and returns user = null…

I assume this is something related to the cookie session, any advice would be much appreciated.

thanks.

Javascript: I cant assign data loaded with AJAX HTTP GET method to properties that were defined in constructor of a class [duplicate]

Im trying to save data loaded from HTTP get method into a class’s properties to work with the data later on the website. I can use the data only within the $.ajax(success: function() {}) , I cant save them into a class’s properties. the code in the success function that makes the ol list from the data does work.

class employees {
  constructor() {
    this.employees = new Array();
  }
  load() {
    $.ajax({
      type: "GET",
      dataType: "json",
      url: "https://localhost:44366/api/employeesget",
      success: data => {
        let list = document.getElementsByClassName("list")[0];
        for (let a of data) {
          let entity = document.createElement("li");
          entity.textContent = `First name is je ${a.FirstName} Last name is ${a.LastName}.Salary is ${a.Salary}`;
            this.employees.push(a); 
         
          list.appendChild(entity);
        }
      },
      error: function(data) {
        alert("error");
      }
    });
  }
}
$(function() {
  let employees01 = new employees();
  employees01.load();
   console.log(employees01.employees[0].FirstName);//I get this error for doing that:Uncaught TypeError: Cannot read properties of undefined (reading 'FirstName')
       // at HTMLDocument.< anonymous >
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ol class="list">
</ol>

Whats the best way to add an SVG to ReactJS

I want to create a component that displays an SVG in React. I am not having any luck, does anyone know a good practice for turns SVG’s into React components.

I tried adding them to <img /> tags and <svg /> tags but i keep getting a broken image icon?

‘TypeError: el.addEventListener is not a function.’ in react-native

I am trying to follow a youtube video on developing a kanban board in react-native, the video tutorial is for react and I am very new to react and react-native or even javascript in general.

App.tsx :

import React, {useState, useRef} from 'react';
import {Text, SafeAreaView, Image, Animated, View, Button, StyleSheet,Pressable,TextInput,TouchableOpacity} from 'react-native';
import {DragDropContext, Droppable, Draggable} from 'react-beautiful-dnd';
//import uuid from 'react-native-uuid';

const itemsFromBackend = [
  {id: "1", content: 'Task1'},
  {id: "2", content: 'Task2'}
];

const columnsFromBackend = [
  {
    'Todo':{
      name : 'Todo',
      items : itemsFromBackend
    }

  }
];

const Kanban = () => {

const [columns, setColumns] = useState(columnsFromBackend)
return(
  <SafeAreaView style = {styles.container} >
    
    <SafeAreaView style= {styles.header_img}>
      <Image  style= {styles.images} source = {require('./assets/Kanban-board-1.png')}></Image>
    </SafeAreaView>
    <SafeAreaView style={styles.header}>
      <Image  style= {styles.images} source = {require('./assets/to_do.png')}></Image>
    </SafeAreaView>

    <SafeAreaView style={{flex:1}}>
      <Text>CONTENT 1</Text>
      <DragDropContext onDragEnd={result=> console.log(result)}>
        {Object.entries(columns).map(([id, column]) => {
          return(
            <Droppable droppableId={id}>
              {(provided, snapshot) => {
                return(
                  <div {...provided.droppableProps} ref={provided.innerRef} style={{
                    backgroundColor: snapshot.isDraggingOver ? 'lightblue' : 'lightgrey',
                    padding: 4,
                    width: 250,
                    minHeight: 500
                  }}>
                    {column.Todo.items.map((item, index) => {
                      return(
                        <Draggable key={item.id} draggableId={item.id} index={index}>
                          {(provided,snapshot) => {
                            return(
                              <div {...provided.draggableProps} {...provided.innerRef} {...provided.draggableProps} style={{
                                userSelect: 'none',
                                padding: 16,
                                margin: '0 0 8px 0',
                                minHeight: '50px',
                                backgroundColor: snapshot.isDragging ? 'yellow' : 'orange',
                                color: 'black',
                                ...provided.draggableProps.style
                              }}>
                                {item.content}
                              </div>
                            );
                          }}
                        </Draggable>
                      );
                    })}
                  </div>
                )
              }}
            </Droppable>
          );
          }
        )
        }
      </DragDropContext>
    </SafeAreaView>
  </SafeAreaView>
);
};

{/* ===================== STYLING COMPONENTS =====================*/}

const styles = StyleSheet.create({

container : {flex:1,
borderWidth:5
},

images: {height:100,
resizeMode:"contain",
  width:300
  },

header : {
  flex:1,
  justifyContent:"center",
  alignItems:"center",
  borderWidth:1,
  margin:1,
  padding: 1
},

header_img : {flex:2,
  justifyContent:"center",
  alignItems:"center",
  borderWidth:1,
  margin:1,
  padding: 1
  },

  threebox : {flex:4,
  flexDirection:"row",
  borderWidth:1}
  
});


export default Kanban;

The following errors are popping up in the error logs of the server when I do ‘expo start’ from the expo-cli and render the app using my phone or browser:-

Error
15:30
Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Kanban`. See https://reactjs.org/link/warning-keys for more information.
Connect(Droppable)@http://2y-38e.amalmajeed.kanban-notes.exp.direct/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:127744:43
    in Kanban (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer

Stack trace:
  node_modules/react-native/Libraries/LogBox/LogBox.js:174:8 in registerError
  node_modules/react-native/Libraries/LogBox/LogBox.js:60:8 in errorImpl
  node_modules/react-native/Libraries/LogBox/LogBox.js:34:4 in console.error
  node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
  node_modules/react/cjs/react-jsx-runtime.development.js:117:4 in printWarning
  node_modules/react/cjs/react-jsx-runtime.development.js:93:16 in error
  node_modules/react/cjs/react-jsx-runtime.development.js:986:9 in validateExplicitKey
  node_modules/react/cjs/react-jsx-runtime.development.js:1013:29 in validateChildKeys
  node_modules/react/cjs/react-jsx-runtime.development.js:1184:27 in jsxWithValidation
  App.tsx:43:6 in Kanban
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:10121:26 in renderWithHooks
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:13183:27 in mountIndeterminateComponent
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:19794:22 in beginWork$1
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18563:22 in performUnitOfWork
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18499:21 in workLoopSync
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18464:18 in renderRootSync
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18158:31 in performSyncWorkOnRoot
  [native code]:null in performSyncWorkOnRoot
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5911:33 in runWithPriority$argument_1
  node_modules/scheduler/cjs/scheduler.development.js:468:23 in unstable_runWithPriority
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5906:23 in flushSyncCallbackQueueImpl
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5893:28 in flushSyncCallbackQueue
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:17745:30 in scheduleUpdateOnFiber
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:21484:23 in updateContainer
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:22144:17 in render
  node_modules/react-native/Libraries/ReactNative/renderApplication.js:58:4 in renderApplication
  node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run
  node_modules/react-native/Libraries/ReactNative/AppRegistry.js:202:4 in runApplication
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:414:4 in __callFunction
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:6 in __guard$argument_0
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:365:10 in __guard
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:4 in callFunctionReturnFlushedQueue
  [native code]:null in callFunctionReturnFlushedQueue
  ...
Error
15:30
TypeError: el.addEventListener is not a function. (In 'el.addEventListener(binding.eventName, binding.fn, options)', 'el.addEventListener' is undefined)

This error is located at:
    in ErrorBoundary (created by DragDropContext)
    in DragDropContext (created by Kanban)
    in RCTSafeAreaView
    in SafeAreaView (created by Kanban)
    in RCTSafeAreaView
    in SafeAreaView (created by Kanban)
    in Kanban (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer

Stack trace:
  node_modules/react-native/Libraries/LogBox/LogBox.js:149:8 in registerError
  node_modules/react-native/Libraries/LogBox/LogBox.js:60:8 in errorImpl
  node_modules/react-native/Libraries/LogBox/LogBox.js:34:4 in console.error
  node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
  node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
  node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
  node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:15792:34 in logCapturedError
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:15884:20 in update.callback
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:7199:2 in callCallback
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:7220:20 in commitUpdateQueue
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:16632:25 in commitLifeCycles
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:19216:22 in commitLayoutEffects
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:93:4 in invokeGuardedCallbackProd
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:318:2 in invokeGuardedCallback
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18952:29 in commitRootImpl
  [native code]:null in commitRootImpl
  node_modules/scheduler/cjs/scheduler.development.js:468:23 in unstable_runWithPriority
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18791:17 in commitRoot
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18192:12 in performSyncWorkOnRoot
  [native code]:null in performSyncWorkOnRoot
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5911:33 in runWithPriority$argument_1
  node_modules/scheduler/cjs/scheduler.development.js:468:23 in unstable_runWithPriority
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5906:23 in flushSyncCallbackQueueImpl
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5893:28 in flushSyncCallbackQueue
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:17745:30 in scheduleUpdateOnFiber
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:21484:23 in updateContainer
  node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:22144:17 in render
  node_modules/react-native/Libraries/ReactNative/renderApplication.js:58:4 in renderApplication
  node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run
  node_modules/react-native/Libraries/ReactNative/AppRegistry.js:202:4 in runApplication
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:414:4 in __callFunction
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:6 in __guard$argument_0
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:365:10 in __guard
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:4 in callFunctionReturnFlushedQueue
  [native code]:null in callFunctionReturnFlushedQueue
  ...
Error
15:30
TypeError: el.addEventListener is not a function. (In 'el.addEventListener(binding.eventName, binding.fn, options)', 'el.addEventListener' is undefined)

This error is located at:
    in ErrorBoundary (created by DragDropContext)
    in DragDropContext (created by Kanban)
    in RCTSafeAreaView
    in SafeAreaView (created by Kanban)
    in RCTSafeAreaView
    in SafeAreaView (created by Kanban)
    in Kanban (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer

Stack trace:
  node_modules/react-native/Libraries/LogBox/LogBox.js:149:8 in registerError
  node_modules/react-native/Libraries/LogBox/LogBox.js:60:8 in errorImpl
  node_modules/react-native/Libraries/LogBox/LogBox.js:34:4 in console.error
  node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
  node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
  node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
  node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
  node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
  node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
  node_modules/regenerator-runtime/runtime.js:294:29 in invoke
  node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
  node_modules/regenerator-runtime/runtime.js:155:27 in invoke
  node_modules/regenerator-runtime/runtime.js:165:18 in PromiseImpl.resolve.then$argument_0
  node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
  node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
  node_modules/react-native/Libraries/Core/Timers/JSTimers.js:123:14 in _callTimer
  node_modules/react-native/Libraries/Core/Timers/JSTimers.js:177:14 in _callImmediatesPass
  node_modules/react-native/Libraries/Core/Timers/JSTimers.js:437:30 in callImmediates
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:388:6 in __callImmediates
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:132:6 in __guard$argument_0
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:365:10 in __guard
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:131:4 in flushedQueue
  [native code]:null in flushedQueue
  [native code]:null in invokeCallbackAndReturnFlushedQueue
  ...

Here is my ‘package.json’ file for the project :

    {
  "name": "kanban-notes",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "buffer": "^6.0.3",
    "expo": "~44.0.0",
    "expo-status-bar": "~1.2.0",
    "react": "17.0.1",
    "react-beautiful-dnd": "^13.1.0",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-draganddrop-board": "^1.0.4",
    "react-native-uuid": "^2.0.1",
    "react-native-web": "0.17.1",
    "uuid": "^8.3.2",
    "uuidv4": "^6.2.12"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~17.0.21",
    "@types/react-beautiful-dnd": "^13.1.2",
    "@types/react-native": "~0.64.12",
    "@types/uuid": "^8.3.4",
    "typescript": "~4.3.5"
  },
  "private": true
}

Not sure how to proceed from here, kindly let me know how to get rid of this ?

P.S : I use VS CODE in Mac to run the expo-cli