Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

comment creer des switch en react js

render() {
    const project = () => {
      switch(this.projectName) {

        case "one":   return <ComponentA />;
        case "two":   return <ComponentB />;
        case "three": return <ComponentC />;
        case "four":  return <ComponentD />;

        default:      return <h1>No project match</h1>
      }
    }

    return (
      <div>{ project() }</div>
    )
  }
Source by askcodez.com #
 
PREVIOUS NEXT
Tagged: #comment #creer #des #switch #en #react #js
ADD COMMENT
Topic
Name
7+5 =