0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

オブジェクトを個々の属性に展開する ...演算子の使い方

Posted at

オブジェクトを個々の属性に展開する ...演算子

MyAttributes.js

import React, {Component} from 'react';

export default class MyAttributes extends Component {
  render(){
    return(
      <ul>
        <li>名前:{this.props.name}</li>
        <li>年齢:{this.props.age}</li>
        <li>性別:{this.props.gender}</li>
      </ul>
    );
  }
}

index.js

const attr = {
  name: "田中",
  age: "31",
  gender: "male",

ReactDOM.render(
  <MyAttrbutes {...atr} />,
  document.getElementById("root");
);
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?