How to pass parameters to a screen that’s not in your stack in react native?

Currently, in order to go from the login page to the userHomeScreen, I check to make sure a user is logged in and onboarded. The routes page automatically goes to the userHomeScreen since that’s the initial route.

I want to display information pulled from an API onto the userHomeScreen upon arrival, but currently it only appears after a re-render. In order to fix this, I called the API on the login page (page before the userHomeScreen) and want to pass the object over to the login page via navigation parameters. How do I go from the login page to the userHomeScreen inside the App Stack. I’ve tried doing navigation.navigate("Home", {screen: "userHomeScreen", params: {user: user_nm}) but I get the "navigation was not handled my any navigator error" . Please help.

This is my auth stack.

const Stack = createNativeStackNavigator();

const AuthStack = () => {
  return (
    <Stack.Navigator
      initialRouteName="Home"
      screenOptions={{
        headerShown: false,
      }}
    >
      <Stack.Screen
        name="Home"
        component={LandingPage}
        options={({ navigation }) => ({ navigation })}
      />
      <Stack.Screen
        name="Login"
        component={LoginScreen}
        options={({ navigation }) => ({ navigation })}
      />
      <Stack.Screen
        name="Registration"
        component={RegistrationScreen}
        options={({ navigation }) => ({ navigation })}
      />
    </Stack.Navigator>
  );
};
export default AuthStack;

This is my AppStack

const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();

const HomeStack = () => {
  return (
    <Stack.Navigator
      initialRouteName="userHomeScreen"
      screenOptions={{ headerShown: false }}
    >
      <Stack.Screen name="userHomeScreen" component={UserHome} />
      <Stack.Screen name="viewRecipeScreen" component={ViewRecipe} />
      <Stack.Screen name="recipeDetailsScreen" component={RecipeDetails} />
      <Stack.Screen name="editProfileScreen" component={EditProfile} />
      <Stack.Screen name="Profile" component={ProfileScreen} />
      <Stack.Screen name="AllFriends" component={FriendsResultsScreen} />
    </Stack.Navigator>
  );
};

const AppStack = () => {
  return (
    <Tab.Navigator
      screenOptions={({ route }) => ({
        tabBarLabelStyle: styles.tabLabel,
        headerShown: false,
        tabBarIcon: ({ focused, size }) => {
          let iconName;
          if (route.name === "Home") {
            iconName = focused ? "home" : "home";
          } else if (route.name === "Add Recipe") {
            iconName = focused ? "plus" : "plus";
          } else if (route.name === "Find Friends") {
            iconName = focused ? "search1" : "search1";
          } else if (route.name === "Profile") {
            iconName = focused ? "profile" : "profile";
          } else if (route.name === "Feed") {
            iconName = focused ? "profile" : "profile";
          }

          // Use the iconName variable in the AntDesign component
          return <AntDesign name={iconName} size={size} color={"#8252ff"} />;
        },
      })}
    >
      <Tab.Screen name="Home" component={HomeStack} />
      <Tab.Screen name="Feed" component={Feed} />
      <Tab.Screen name="Add Recipe" component={AddRecipe} />
      <Tab.Screen name="Find Friends" component={OurQuery} />
      <Tab.Screen name="Profile" component={ProfileScreen} />
      {/* <Tab.Screen name="viewRecipeScreen" component={ViewRecipe} /> */}
    </Tab.Navigator>
  );
};

export default AppStack;

This is my routes page

const Routes = () => {
  const { user, isOnboarded, initializing } = useContext(AuthContext);

  if (initializing) return null;

  return (
    <NavigationContainer>
      {user ? (
        isOnboarded ? (
          <AppStack />
        ) : (
          <RegistrationStack />
        )
      ) : (
        <AuthStack />
      )}
    </NavigationContainer>
  );
};

export default Routes;

How do I use SVGs in AstroJS?

Going to their Docs @ AstroDocs

Astro.js Example

import imgReference from './image.png'; // imgReference === '/src/image.png'
import svgReference from './image.svg'; // svgReference === '/src/image.svg'
import txtReference from './words.txt'; // txtReference === '/src/words.txt'

// This example uses JSX, but you can use import references with any framework.
<img src={imgReference} alt="image description" />;

They import and reference the file.


Things I’ve Tried to do:

  1. Move the SVG in /public and /src to isolate the situation.
  2. Renamed file to ui.svg to simplify naming issues.
  3. Imported the svg as a component.

Nothing works it seems. Any help?

My index.astro

---
// import Settings from './icons/Settings.svg';
import ui from '../ui.svg'; // moved here and renamed file to remove potential issues.
---

<html lang="en">
    <head>
        <meta charset="utf-8" />
        <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
        <meta name="viewport" content="width=device-width" />
        <meta name="generator" content={Astro.generator} />
        <title>Mudriy | Home</title>
    </head>
    <body>
        <h1>Astro</h1>
        <!-- <img src={Settings} alt="ff"/> -->
        <img src={ui} />
    </body>
</html>

remove/hide with specific content?

I imported hundreds of posts from Drupal to WordPress, and they all came in nicely. I did not create the content on Drupal, and I’m discovering that all of the posts have multiple

enter image description here

statements at the top, which is driving down the top of the content with blank lines. These are appearing in the inspector as

enter image description here

I can’t edit each of these hundreds of posts, so I’m hoping there’s a way with code (CSS (unlikely), JavaScript?) to hide any p with that character/code as its only content.

Tried CSS, but can’t hide things like this with it.

setting the font-size makes the div bigger in a grid

i want to make a tic-tac-toe game in HTML/CSS/JS and i tried to raise the font-size but it raises the width/height of the div, and i cant set a width/height for the div because its in a grid.(if you have a better approach than this or images please leave a comment)

body{
    margin: 0;
    background-color: #E1D9D1;
}

#board{
    display: grid;
    grid-template-columns: auto auto auto;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30vw;
    height: 30vw;
    gap: 1vmin;
}

.square{
    font-family: 'Nunito', sans-serif;
    background-color: #252525;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 10vw;
    max-height: 10vw;
    font-size: 1vw;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <title>TicTacToe</title>
</head>
<body>
    
<div id="board">
    <div class="square">X</div>
    <div class="square">O</div>
    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
    <div class="square"></div>
</div>

</body>
</html>

Method to execute JS code securely, with control over starting/stopping and also exposing specific API’s to the code

I’m using blockly in my electron app, and I wanted a way to be able to execute the user’s code. I originally inserted a script into the HTML with the generated code from my preload file, but I’m not able to stop the code from running, because from what I see I can’t just stop a script during execution.

The blockly docs recommend using JS-Interpreter. However, after looking through the docs I have a few reservations which I’m not sure about:

  1. I want to be able to have access to some libraries which I include in my HTML as scripts linked to online resources, and since it’s sandboxed I don’t think I can.
  2. I also want to be able to require(‘path’), and import some classes which I define in a different JS file in my project. I currently just use require to import them, but since they’re sandboxed I’m not sure if I’ll be able to access them. I can see how allowing the user to require(‘fs’) could be very destructive, but if possible it would be great to only allow access to a few libraries.
  3. The docs state JS-Interpreter as running “about 200 times slower than native JavaScript.” I would like to be able to run programs faster than that, as the kind of program the user would generate might take a few minutes with the script injection method.

Is there a different way to execute JS while being able to access the libraries, import classes, and also run without a significant performance loss?

reCAPTCHA Error Invalid domain for site key on localhosted website

I am trying to render Recaptcha V2 Enterprise with site-key from other website on my local host. Normally, you will get error “invalid domain” if you are using external site-key

I needed it for manual solving and getting “solve-token”, and then post token to origin website by request. I am able to render, solve and get token only by changing my DNS redirect in hosts file, but i am unable to reach origin website to post token cause it conflicts with my local website. Is there any way to render Recaptcha at local website without changing redirection and getting error “invalid domain”?

Select X numbers from an array to match given value X

I have a problem to solve in JavaScript and I am not sure where to start.
I will have an array of values.

[1000, 500, 400, 300, 200, 100]

I will be given two numbers

X number of array elements to use.

N Value that the elements must add up to

Sorry but as I don’t know where to start, I do not have any attempted code to share.

Any tips on where to start would be greatly appreciated

open input file with default name

How to put the name of a file automatically when opening an input file? so that when opening the file browser it automatically searches for a file called namedefault.xml for example.

I have my code in VUE, it is the following:

<v-col cols="12" sm="6" >
   <v-file-input ref="filexml" dense outlined required :label="t.uploadXML" accept=".xml" small-chips truncate-length="13" v-model="filexml" :rules="rules.filexml"></v-file-input>
   <v-spacer></v-spacer>
   <v-file-input ref="filepdf" dense outlined required :label="t.uploadPDF" accept=".pdf" show-size small-chips truncate-length="13" v-model="filepdf" :rules="rules.filepdf"></v-file-input>
</v-col>

when opening filexml I want the search box to open as in the following image:
IMAGE

How to make a website store user data but anybody can see that data when they open the site? [closed]

I would like to use vanilla js for this if possible, what I would like to do would be to store data similar to the function localStorage but I want every user that opens the site to see the info.

I really cant find anything online about storing data in this way, I’ve looked at several different websites and used different searches but I can’t find anything on it.

How to listen to Container Style Query change

Update 1 – I found a horrible workaround based on a custom property + ResizeObserver + window.getComputedStyle(), it might hold the water until a better solution arrives. It’d be still be great to know if the listener is coming.

I’m looking to add a listener for a container style query change after exhausting all other avenues (such as MutationObserver etc.), by analogy with media queries.

Does this possibility exist even as an experimental feature or is it planned at all any inside is highly appreciated.

Does anyone knows how to fix this in react, im leaarning the language but it kept telling me this. Some help please? [closed]

I tried importing the NavBar from different parts in the src but still not working. I applied css, javascript on the NavBar but still wont work

import logo from "./logo.svg";
import "./App.css";
import NavBar from "../components/NavBar";
import "bootstrap/dist/css/bootstrap.min.css";

function App() {
  return (
    <div className="App">
      <NavBar />
    </div>
  );
}

export default App;
import { useState, useEffect } from "react";
import { Navbar, Container, Nav } from "react-bootstrap";
import logo from "../Assets/img/logo.svg";
import navIcon1 from "../Assets/img/nav-icon1.svg";
import navIcon2 from "../Assets/img/nav-icon2.svg";
import navIcon3 from "../Assets/img/nav-icon3.svg";`

Find duplicates from two arrays of objects and return boolean (Javascript)

There are two arrays of objects and I need to check if there’s any property that’s matching by comparing those two arrays. For example,

const array1 = [{name: 'foo', phoneNumber: 'bar'}, {name: 'hello', phoneNumber: 'world'}]
const array2 = [{name: 'hi', phoneNumber: 'earth'}, {name: 'foo', phoneNumber: 'bar'}]

In this case since 1 property from each array is matching and I would like to return true. In case of none of the properties matching I would like to return false.

Thanks in advance!

Error: Could not establish connection. Receiving end does not exis

So my issue is that I want to make a chrome extension to read the header and content of a webpage, but I am stuck at the initial stage of development, where this error shows up and the debug message doesn’t appear.
The code is as follows:
MANIFEST VERSION 3

content.js

(() => {
  chrome.runtime.onMessage.addListener((obj, sender, response) => {
    
      const { type, value } = obj;
  
        if (type === "NEW") {
        console.log("Hi");
        newVideoLoaded();
        response([]);
        chrome.runtime.lastError ;
      }
    });
  })();

background.js

chrome.tabs.onUpdated.addListener((tabId, tab) => {
    if (tab.url && tab.url.includes("cnbc")) {


        console.log("Hello world");
        chrome.tabs.sendMessage(tabId, {
        type : 'NEW',
        value: ''
        
      });
    }
  });

The error appears, and there is a similar question whose answers i tried but it didn’t work.
Please help!

I want to make a chrome extension to read the header and content of a webpage, but I am stuck at the initial stage of development, where this error shows up and the debug message doesn’t appear.

Trying to link to a specific shuffle state using Shuffle.js on another page

I’m using a gallery called Shuffle.js – https://vestride.github.io/Shuffle/ – for a house painter’s website. The gallery sorts by service type (i.e. “carpentry, etc.”) and it functions fine. I have links on individual service pages under the “What Makes Us Different” paragraph – https://scotlandpaintingco.com/carpentry.html – that say “see more examples of our carpentry work” that link to the gallery on the “Our Work” page – https://scotlandpaintingco.com/our-work.html. What I’m trying to do is make a unique href for each service page that links to the gallery already filtered for that category on page load (i.e. “carpentry”) instead of “Show All”.

I haven’t been able to figure out how to implement this but understand that I need to use JS to add a fragment link to “our-work.html”. (i.e. “our-work.html#carpentry”) whenever a specific filter is selected, and the fragment must have the service value (the gallery uses data-groups). Then I can link from the service pages using a url with the hashtag. I keep coming across “window.location.hash” in other forums but I can’t figure out how to use this to accomplish my goal or how to integrate it into the code.

javascript enter a value in textbox check my code

I am trying to fill in a text box on a browser using the code I have.
It adds the value to the text box but as soon as I click text box it disappears.

Looking at the Firefox element checker I can see the actual value =”” in HTML not changing only the front of html being inputted.

here is the code i have and html.

here is the javascript code am using

document.getElementsByClassName(
  'appearance-none block w-full px-3 py-2.5 border placeholder-gray-400 focus:outline-none text-sm rounded-lg border-gray-200 focus:ring-1 focus:border-transparent focus:ring-purple-1'
)[0].value = 'your value';

here is part of the html

<input
    class="appearance-none block w-full px-3 py-2.5 border placeholder-gray-400 focus:outline-none text-sm rounded-lg border-gray-200 focus:ring-1 focus:border-transparent focus:ring-purple-1"
    placeholder="Artificial Intelligence in Copywriting" 
    value="">

extra code

<div><div class="flex justify-between items-center relative w-full"><div class="flex flex-wrap mb-1 items-center "><label class="block text-base font-medium text-gray-700">Title</label><span class="ml-1 text-red-500">*</span></div><p class="text-xxs font-medium text-gray-400">1 / 200</p></div><div class="flex items-center"><div class="relative w-full"><input class="appearance-none block w-full px-3 py-2.5 border placeholder-gray-400 focus:outline-none text-sm rounded-lg border-gray-200 focus:ring-1 focus:border-transparent focus:ring-purple-1" placeholder="Artificial Intelligence in Copywriting" value=""></div></div></div>