score:18
it seems that somewhere in this code you have an element with an explicit javascript code somewhere in it's attributes. something along the lines of
<a href="javascript:;" ...>...</a>
as the warning mentions: react was passed "javascript:;"
. this is probably some old repo, that was using this to get away with <a>
tags that do not lead anywhere. the more common solution to this is usig href='#'
.
however, the 404 you are getting is probably signifying something more and the repo itself is probably broken.
score:0
you can define a component based on a
element. the followings are a bunch of code snippets.
import react, { fc, mouseevent } from 'react'
import classnames from 'classnames'
import './navigator.scss'
export interface inavigatorprops {
classname?: string
prefixcls?: string
style?: react.cssproperties
url: string
onclick?: (event: mouseevent<htmlanchorelement>) => void
}
export const navigator: fc<inavigatorprops> = ({
style,
children,
url: oldurl,
classname = '',
onclick: oldonclick,
prefixcls = 'pa-navigator',
}) => {
const classnamestring = classnames(classname, prefixcls)
let [url = oldurl, onclick = oldonclick] = []
if (/^javascript:/.test(url) || url === '#') {
// @ts-ignore
url = undefined
onclick = (event) => {
event.stoppropagation()
oldonclick?.call(object.create(null), event)
}
}
return (
<a
href={url}
style={style}
classname={classnamestring}
onclick={onclick}
rel='noopener noreferrer'
>
{children}
</a>
)
}
Source: stackoverflow.com
Related Query
- Warning: A future version of React will block javascript
- Warning: a div tag was passed a numeric string value for CSS property fontSize which will be treated as a unitless number in a future version of React
- How will my React.render function access external javascript file containing react code?
- findDOMNode is deprecated in StrictMode. Warning - react-transition-group + react v17 + Javascript (Not Typescript)
- How to use destructing in JavaScript — in a helper function which will be passed to a React component?
- HTML JavaScript React: Front-End React Component Throwing react-dom.development.js:506 Warning
- Rails 5 Redux React Server Side Rendering gives client side JavaScript warning 'Replacing React-rendered children with a new...'
- I need help pinpointing why my React Materials UI mobile version of AppBar will not render?
- How to fix missing dependency warning when using useEffect React Hook
- How can one tell the version of React running at runtime in the browser?
- Get version number from package.json in React Redux (create-react-app)
- What will happen if I use setState() function in constructor of a Class in ReactJS or React Native?
- Upgrading React version and it's dependencies by reading package.json
- New React Native project with old version of react native
- Question mark before dot in javascript / react
- React Router - Typescript errors on withRouter after updating version
- React 16 warning "warning.js:36 Warning: Did not expect server HTML to contain a <div> in <div>."
- How can I block a React component to be rendered until I fetched all informations?
- What does React Native use to allow JavaScript to be executed on iOS and Android natively?
- react native downloading javascript bundle 100% stuck
- How to build a production version of React without minification?
- React warning about setState in unmounted component
- Writing embeddable Javascript plugin with React & Webpack
- Call external Javascript function from react components
- React npm start not working : 'No version of chokidar available'
- React warning Maximum update depth exceeded
- Why eslint consider JSX or some react @types undefined, since upgrade typescript-eslint/parser to version 4.0.0
- React Javascript displaying/decoding unicode characters
- npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap
- Set React Input Field Value from JavaScript or JQuery
More Query from same tag
- Component is returning a TypeError: Cannot read property 'map' of undefined
- Using node modules in Laravel
- (node:28917) UnhandledPromiseRejectionWarning: TypeError: data is not iterable
- I need my ReactJS app working offline without server
- react redux does not dispatch
- Communication between React.js and Rails Model
- Update Component in react after clicking in parent
- Append child element in full calendar api using eventRender?
- Update Redux State & Then Get The Updated State In Same Instance
- access specific object value and change it using lodash
- Fetching and organizing data and rendering the response
- Use more than three colors in Material UI Primary Color Theme
- Regarding creating React components
- react state extend multilevel object not working
- Calling a function only when another function finishes running in React
- React radio not resetting the values
- How can I request the value I get from the user to the backend api using react?
- Preventing Next.js from generating certain path files
- How can i prevent reloading the whole page? I don't want to reload the Navbar, only load the components inside using react-router-dom
- Webpack: Need an appropriate loader to handle this file type error
- Retrieve Input value from Action onClick in SemanticUI
- Graphql Mutation error - errors: [{message: "Variable "$firstName" of required type "String!" was not provided.",…}]
- React what to use in production instead of proxy?
- ReactJS: always transfer props to child component
- Style a RadioButtonInput used as a filter on a react-admin list?
- Fluent UI style not working in passed commands with buttons to CommandBar
- Reset component state in React
- React-Router-Redux and React-Bootstrap
- Why scale.ticks(number) from d3 does not work as expect?
- send form values from child function component to parent class component