Skip to content

Commit f132079

Browse files
authored
Fix React deprecation warning
``` Warning: A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed "javascript:void(0);". in a (created by Item) in li (created by Item) in Item (created by ADPagination) in ADPagination (created by TableFooter) in ul (created by TableFooter) in nav (created by TableFooter) in div (created by TableFooter) in div (created by TableFooter) in TableFooter (created by ReactDatatable) in div (created by ReactDatatable) in ReactDatatable (created by DataTable) ... ```
1 parent 9d05b8c commit f132079

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ADPagination.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default function ADPagination(props){
99
let Item = function(props) {
1010
let className = (props.className) || "";
1111
return(<li className={"page-item " + className}>
12-
<a href='javascript:void(0);' className="page-link" tabIndex="-1"
13-
onClick={props.onClick}>
12+
<a href='#' className="page-link" tabIndex="-1"
13+
onClick={(e) => { e.preventDefault(); props.onClick(e) }}>
1414
{props.children}
1515
</a>
1616
</li>);
@@ -71,4 +71,4 @@ export default function ADPagination(props){
7171
</Item>);
7272

7373
return tags;
74-
}
74+
}

0 commit comments

Comments
 (0)