score:0
Accepted answer
the error message says onclick
prop doesn't accept string
s, only function
s. you can update your onclick
, just pass a function and check the row.values.status
in there:
<link
onclick={(e) => {
if (row.values.status == 'ok') {
e.preventdefault();
} else {
// do something else if `status` is not `ok`
}
}}
>
action
</link>;
score:0
you are passing a string to onclick. you should declare a new onclick function and pass it on onclick attribute like below.
const onclick= (e) => {
if (row.values.status == "ok"){
e.preventdefault();}
}
onclick={onclick}
Source: stackoverflow.com
Related Query
- react js issue occurred with Link tag
- React img tag issue with url and class
- Alter text in span tag dynamically with React issue
- How can I replace bits or string with React component, react-router-dom Link or an anchor tag <a></a>
- How do I select Link tag in React Router Dom with CSS?
- React Router base URL issue and link tag issue
- How to pass function as prop in react routerv5 with the Link tag
- React Navbar issue with link locaton
- I am building react app with ag-grid and I am having an issue with trying how to put a link in the cell
- Issue with babel-jest dependency when running npm start in a React app
- Formatting code with <pre> tag in React and JSX
- react link vs a tag and arrow function
- Facing issue while adding radio button in react - input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`
- Typing a dynamic tag in React with TypeScript?
- History.push a link to a new tab with react router
- Create React App Dependency Issue with Webpack
- CORS Issue with React app and Laravel API
- Having an issue with e.target.value returning Undefined in React
- Adding React-Redux to a React app with React.StrictMode tag
- Can I use react router Link with CardActionArea?
- How can I change the color of a Link in React with Material-UI?
- Symlinking react modules with npm link for local development gives error
- Unexpected end of JSON on GraphQL query with React while no issue with GraphiQL
- React and typescript with webpack typing issue
- Issue with async default value in React Material UI Autocomplete
- Jest with React Native getting issue
- React js - problem with proxy for web socket link in react
- react router dom link with params dont allways work
- CORS issue with Django and React hosted on same server
- Testing React Router with Link
More Query from same tag
- Creating a DRY version of gatsby-browser.js gatsby-ssr.js
- How to add unit test for window keydown event in ReactJS with enzyme
- React Material Design Icon hover not working correctly
- Error when I return an object by an inline function call into another object in ES6/Reactjs
- Why i get hashed .jpeg file when running 'npm run build' with webpack
- TypeScript 3: JSX element type 'Component' does not have any construct or call signatures. [2604]
- Type '{ 'x-access-token': any; } | { 'x-access-token'?: undefined; }' is not assignable to type 'AxiosRequestHeaders | undefined'
- Material UI select multiple dates with Calendar
- React Component keeps on Rendering
- JS - Auto Change Inheriting Classes
- react-csv: downloaded csv breaks tab after " "
- useState not updating an array at all
- HTML to rendered html
- What is the best practice to write condition when you need to display value even if it zero
- React unit test with enzyme, test onBlur functionality
- error - unhandledRejection: Error: Not supported at Object.react-markdown
- Using React and SCSS, I can't get any @mixins to work
- Only Root Route is being rendered. IndexRoute Not Rendering Components
- Children useCallback dependency hell
- How to use CSS Modules with webpack in React isomorphic app?
- Slate: How to find when Editor has fully rendered
- How does relay or Apollo-react solve mutations that involve multiple relationships
- Concat prop value with string in styled-component
- support for the experimental syntax 'jsx' isn't currently enabled laravel 8
- React Native Rendering with SetInterval Issue
- How to send component's state as payload to store
- React: Pass incoming service data to children
- Loop inside a react component
- React : TypeError: Cannot read property 'Item' of undefined
- React routing path