<a> tag react

时间:2017-01-09 17:09:19

标签: reactjs

I am new to reactjs.I am trying to set herf attribute to the anchor element but getting warning like Unknown prop herf on <a> tag. Remove this prop from the element.

In employees.js.jsx file:

var Employees = React.createClass({
render: function() {
employees = this.props.props.employees.map( function(employee) {
  return (
    <tr key={employee.id}>
      <td>{employee.name}</td>
      <td>{employee.email}</td>
      <td>{employee.manager}</td>
      <td><a herf={'/employees/' + employee.id}>Edit</a></td>
    </tr>
  );
});....

How do i set herf attribute to the element.Thanks.

1 个答案:

答案 0 :(得分:1)

锚元素没有herf属性,将herf更改为href