Skip to content

Translate Warnings/legacy-factories #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions content/warnings/legacy-factories.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: React Element Factories and JSX Warning
title: React Element Factories dan Peringatan JSX
layout: single
permalink: warnings/legacy-factories.html
---

You probably came here because your code is calling your component as a plain function call. This is now deprecated:
Anda kemungkinan berada di sini karena kode Anda memanggil komponen sebagai _function call_ biasa. Hal ini sekarang sudah usang:

```javascript
var MyComponent = require('MyComponent');
Expand All @@ -16,7 +16,7 @@ function render() {

## JSX {#jsx}

React components can no longer be called directly like this. Instead [you can use JSX](/docs/jsx-in-depth.html).
Komponen React tidak lagi dapat dipanggil seperti ini. Sebagai gantinya [Anda dapat menggunakan JSX](/docs/jsx-in-depth.html).

```javascript
var React = require('react');
Expand All @@ -27,9 +27,9 @@ function render() {
}
```

## Without JSX {#without-jsx}
## Tanpa JSX {#without-jsx}

If you don't want to, or can't use JSX, then you'll need to wrap your component in a factory before calling it:
Jika Anda tidak ingin atau tidak dapat menggunakan JSX, Anda perlu membungkus komponen Anda dalam sebuah _factory_ sebelum pemanggilan:

```javascript
var React = require('react');
Expand All @@ -40,11 +40,11 @@ function render() {
}
```

This is an easy upgrade path if you have a lot of existing function calls.
Hal ini merupakan langkah pembaruan yang mudah jika Anda memiliki banyak _function call_ yang sudah ada.

## Dynamic components without JSX {#dynamic-components-without-jsx}
## Komponen dinamis tanpa JSX {#dynamic-components-without-jsx}

If you get a component class from a dynamic source, then it might be unnecessary to create a factory that you immediately invoke. Instead you can just create your element inline:
Jika anda mendapatkan komponen kelas dari sumber dinamis, tidaklah begitu perlu membuat _factory_ yang dipanggil secara langsung. Sebagai gantinya, Anda dapat saja membuat elemen _inline_:

```javascript
var React = require('react');
Expand All @@ -54,6 +54,6 @@ function render(MyComponent) {
}
```

## In Depth {#in-depth}
## Pembahasan Mendalam {#in-depth}

[Read more about WHY we're making this change.](https://gist.github.com/sebmarkbage/d7bce729f38730399d28)
[Baca lebih lanjut tentang kenapa kita membuat perubahan ini.](https://gist.github.com/sebmarkbage/d7bce729f38730399d28)