如何将组件导入UI?

问题描述 投票:0回答:5

[抱歉,我是React.js的新手,刚从Java切换过来,我不明白如何在UI上显示地图。给我一个提示

import React from "react";
import {Map, GoogleApiWrapper} from 'google-maps-react';

class TestMap extends Component {
  render() {
    return (
      <div className="GoogleMap">
        <Map google={this.props.google} zoom={14} />
      </div>
    );
  }
}

GoogleApiWrapper({ 
  apiKey: ({api-key})
})(TestMap);

export {TestMap, GoogleApiWrapper};

这里:

import React, { Component } from 'react';
import {TestMap} from '../components/map/google/TestMap';

class Map extends Component {
    render() {
        return (
          //???
        );
    }
}

export default Map;
javascript reactjs react-component
5个回答
1
投票
也建议您从这里开始,Getting Started

import React, { Component } from 'react'; import {TestMap} from '../components/map/google/TestMap'; class Map extends Component { render() { return ( <TestMap /> ); } }


1
投票

1
投票

0
投票
© www.soinside.com 2019 - 2024. All rights reserved.