key
, особенно тогда, когда вы собираетесь этот массив изменять - плохая идея. Ключ должен быть жёстко привязан к конкретному элементу, индексы в массиве этого не обеспечивают.removeItem()
, должен в неё передавать тот самый идентификатор, по которому вы будете удалять элемент.{comments.map((comment) => (
<CommentItem
key={comment.id}
id={comment.id}
userName={comment.userName}
commentText={comment.commentText}
currentDate={comment.currentDate}
currentTime={comment.currentTime}
removeItem={removeCommentItem}
/>
)}
CommentItem = (id, removeItem) => {
return (
<button onClick={() => removeItem(id)}>Удалить</button>
)
};
const give_link = document.getElementById('give_link')
const receive_link = document.getElementById('receive_link')
const btn_create_link = document.getElementById('btn_create_link')
btn_create_link.onclick = function() {
receive_link.value = give_link.value;
}
receive_link.value = `<a href="${give_link.value}">${give_link.value}</a>`;
Получается, что он заменит мой файл своимНе заменит, потому что когда он попытается свои правки отправить, он получит сообщение о том, что есть конфликты, которые нужно руками разрешить.
Правильно ли я понимаюГит на сервере никак не связан с вашим компьютером.
Нормально лиДа делайте как хотите, полиции гита урезали финансирование и они теперь никого не арестовывают. Но вообще для "кусков кода" есть https://gist.github.com.
public function scopeByPartnerId($query, int|array $partnerId)
{
if (is_countable($partnerId)) {
$query->whereIn('partner_id', $partnerId);
} else {
$query->where('partner_id', $partnerId);
}
}
The C programming language allows programs exiting or returning from the main function to signal success or failure by returning an integer, or returning the macros EXIT_SUCCESS and EXIT_FAILURE. On Unix-like systems these are equal to 0 and 1 respectively.[3] A C program may also use the exit() function specifying the integer status or exit macro as the first parameter.
The return value from main is passed to the exit function, which for values zero, EXIT_SUCCESS or EXIT_FAILURE may translate it to “an implementation defined form” of successful termination or unsuccessful termination.
Apart from zero and the macros EXIT_SUCCESS and EXIT_FAILURE, the C standard does not define the meaning of return codes. Rules for the use of return codes vary on different platforms (see the platform-specific sections).